Quote:
Originally Posted by MrPickle
int myArray[100];
Will the array 400 bytes big, right away?
This is a minor point and slightly off topic for the question but the size of the array will be 100 * sizeof(int). It sounds like your system has 4 byte ints which would make the result of that calculation 400 bytes but ints are not the same size on all platforms. Plenty of platforms have 2 byte ints and some even have 1 byte ints.
An int is supposed to be the size that the platform find easiest to process (i.e. most efficient) 1 byte on an 8 bit platform, 2 bytes on a 16 bit platform 4 bytes on a 32 bit platform. In practice int is most often 2 or 4 bytes (some 8 bit platforms still use 2 byte ints).
In theory the modern 64 bit platforms should have 8 byte ints (and longs) but for some reason most of the compiler manufactures decided to keep ints and longs 4 byte and add the 8 byte long long. IMO this was most likely to prevent breaking all that code out there that assumes long is 4 bytes.