之前面试遇到过,和操作系统环境有关,是编译器去适应平台.所以真正决定占多少字节取决于你的device platforms. 其实无论哪种模型short和char无论哪种model下都保持一致. 我们见得最多的就是ILP32LL模型.这种模型下int和long已经pointer占4个字节 long long占8个字节. 参见下面的注释: As you can see, the typical data type sizes match the ILP32LL model, which is what most compilers adhere to on 32-bit platforms. The LP64 model is the de facto standard for compilers that generate code for 64-bit platforms.