Question

we have 3 variables defined in C++ program int a char b int c what would be the memory occupied by these in x86 & x64 processors ?

Was it helpful?

Solution

For 32-bit systems, the data model standard is ILP32 - int, long, ptr and off_t are all 32 bits (4 bytes) in size.

For 64-bit systems, the standard is LP64 (Long-Pointer 64) - int is 32 bits in size. long, ptr, and off_t are all 64 bits (8 bytes) in size. Char is 1 byte in both cases. You may get a detailed discussion on data model here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top