简体   繁体   中英

memory requirement in x86 & x64 processors

我们在 C++ 程序中定义了 3 个变量 int a char b int c 在 x86 和 x64 处理器中这些变量占用的内存是多少?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM