typedef struct node{
char one;
char two;
struct node *next;
} nodea;
I'm thinking in terms of compiler padding, is there any way I can make the sizeof(nodea) smaller than 16?
Personally, I think no matter the program is 32-bit or 64-bit , the size of structure should always be 16 bytes (since char is 1 byte long, and the alignment of double is 8 bytes).
1 gigahertz (GHz) or faster 32-bit (x86) or 64-bit (x64) processor* 1 gigabyte (GB) RAM (32-bit) or 2 GB RAM (64-bit) 16 GB available hard disk space (32-bit) or 20 GB (64-bit)
The theoretical memory limit that a 64-bit computer can address is about 16 exabytes (16 billion gigabytes), Windows XP x64 is currently limited to 128 GB of physical memory and 8 TB of virtual memory. In the future this limit will be increased, basically because hardware capabilities will improve.
A 64-bit processor includes a 64-bit register, which can store 264 or 18,446,744,073,709,551,616 values. Therefore, a 64-bit register is not twice as large as a 32-bit register, but is 4,294,967,296 times larger.
You can use the #pragma pack
compiler directive http://msdn.microsoft.com/en-us/library/2e70t5y1%28v=vs.80%29.aspx
#pragma pack(push)
#pragma pack(1)
typedef struct node {
char one;
char two;
struct node* next;
} nodea;
#pragma pack(pop)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With