I always like to use the variable with the smallest size that will work just fine, But would this really gain me if I used short byte integers instead of integer, and the memory is 32bit word addressable, Does the compiler do something to enhance memory usage ?
Share
For local variables, it probably doesn’t make much as much sense, but using smaller integers in structures where you have thousands or even millions of items, you can save a considerable amount of memory.