Hi, suppose I have a class defined as follows
class foo
{
char [10] bar;
}
How would the size of this class differ when in a 64 bit environment compared to a 32 bit one, assuming no padding/packing.
I believe the 64 bit version of the class would be 4 more bytes in length since:
- The class must contain a char* in order to point to the start of the array bar
- an char* is 8 bytes in a 64 bit environment vs 4 bytes in a 32 bit environment
Am I correct?
Thanks!
A further question about how arrays actually work If there is no pointer stored when you declare an array, how come you can get an address out of the array name and do things like bar[0], bar[1], etc?