1. Print short, long, long long and unsigned
#include <stdio.h>intMainvoid) {unsignedintUN =3000000000; ShortEnd = $; LongBig =65537; Long LongVerybig =12345678908642; printf ("un =%u and not%d\n", UN, un);//U=udprintf"end =%hd and%d\n", end, end); printf ("big =%ld and not%hd\n", big, big); printf ("Verybig=%lld and not%ld\n", Verybig, Verybig); return 0;}
Conclusion: Even if the variable itself is an unsigned type, you need to add u when printing, otherwise print according to the signed type; If you print a long type with a short type, the last n bits will be intercepted
2. Eight binary or hexadecimal denotes one character
Char ' \0101 ' ; Char ' \x41 ';
PS: Why use ' \0101 ' instead of 0101 to denote a character, because ' \0101 ' is more articulate with the intent of a character, followed by an escape sequence such as ' \0101 ' can be embedded in a C string, such as "hello!\0101\n"
3.
C-c Primer Plus Read notes