printf函数可以方便的打印各种变量和字符串,例如printf(“%s”,buf_in),可以打印buf_in数组的字符串,使用的时候需要定义头文件#include<stdio.h>。
当unsigned char buf_in[] = {‘{’,‘"’,‘c’,‘u’,‘r’,‘r’,‘e’,‘n’,‘t’,‘"’,‘:’,‘\0’};末尾的’\0’可以结束printf打印,防止输出回车行。当unsigned char buf_in[] = “current”;printf打印不会有上述的问题。
C语言中的printf函数使用小心得
于 2024-10-23 16:09:54 首次发布