printf???C????????????,?????:
- ??:
printf("???????", ??1, ??2, ...);
??,???????
?????????????????,?????????,????????????
- ???????:
%d
:???????????\u
:???????????%f
:??????%c
:???????%s
:????????%p
:???????
- ??:
int num = 10; float f = 3.14; char ch = 'A'; char str[10] = "Hello"; printf("??:%d\n", num); printf("???:%f\n", f); printf("??:%c\n", ch); printf("???:%s\n", str); printf("??:%p\n", &num);
????:
??:10 ???:3.140000 ??:A ???:Hello ??:0x7ffd324e6aac
??:?????????,%
???????????????????????,??]
???????5??????,%.2f
??????????????????????????C?????????????