请问若将字符型数据转换为int型怎样转换?例如:char x=0xddff; printf("%d\n",x);具体步骤是怎样的?

热心网友

先将其转为二进制,得1101,1101,1111,1111,再取原码.

热心网友

x=(int)0xddff这样就行了