unsigned
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
unsigned char a = 200;//无符整型
unsigned char b = 100;
unsigned char c = 0;
c = a + b;//整型提升
printf("%d %d", a + b, c);//300,44
}
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
unsigned int a = 0x1234;
unsigned char b = *(unsigned char*)&a;
printf("%d\n", b);//52
return 0;
}
字符长度问题
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int main() {
char a