Ctype
C 语言中不同的 char
- char, signed char, unsigned char 是三种不同的类型
例子:
char a=-1;
signed char b = -1;
unsigned char c = -1;
printf("%d %d %d",a,b,c)
x86: -1 -1 255
arm: 255 -1 255
ppc: 255 -1 255
gcc 编译选项有:
-funsigned-char
-fno-signed-char
-fsigned-char
-fno-unsigned-char
这四个参数是对char类型进行设置,决定将char类型设置成unsigned char(前两个参数)或者 signed char(后两个参数)