首先我陈述一下:在c++中,32位机,int占4位32bit,short占2位16bit,long占4位32bit,char占1位
我在输出的时候程序如下
#include
using std::cout;
using std::endl;
int main()
{
union{short i[2];long k;char c[4];}r,*s=&r;
char m=0x39;
s->i[0]=0x39;s->i[1]=0x38;
cout<<(s->c[0])<
cout<
}
在输出char型0x39怎么会输出9呢,是不是与unicode码有关??