【发布时间】:2013-11-30 20:19:44
【问题描述】:
我不明白为什么会这样
#include <stdio.h>
#include <stdint.h>
typedef int16_t my_type;
my_type value = 0xFC7F;
int main(int argc, const char * argv[])
{
printf("0x%02X\n", value);
printf("Type uses %lu bytes\n", sizeof(my_type));
}
输出这个
0xFFFFFC7F
Type uses 2 bytes
Program ended with exit code: 0
而不是
0xFC7F
Type uses 2 bytes
Program ended with exit code: 0
我在 OSX 10.9 上使用 XCode 5
【问题讨论】:
标签: c