都是把格式好的字符串输出,只是输出的目标不一样:1. Printf,是把格式字符串输出到标准输出(一般是屏幕,可以重定向)。2. Sprintf,是把格式字符串输出到指定字符串中,所以参数比printf多一个char*。那就是目标字符串地址。(字符串格式化,并把格式化后的字符串返回,所以可以用于赋值操作)3. Fprintf, 是把格式字符串输出到指定文件设备中,所以参数笔printf多一个文件指针FILE*。
参考链接: https://blog.csdn.net/weixin_34355881/article/details/86332855?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase