c++中的printf和fprintf

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34806812/article/details/82021474

printf("%s",stringVar) <===>fprintf(stdout,"%s",stringVar)

printf是对fprintf的另一层包含使用,printf其实就是fprintf的第一个参数设置为stdout。

printf默认了操作的文件为标准输出文件stdout,而fprintf可以指定第一个参数为操作的文件,

这个文件和标准输出设备(屏幕)建立了某种关联,当数据写到这个文件里面的时候,屏幕就会通过既定的方式把你写进去的东西显示出来

猜你喜欢

转载自blog.csdn.net/qq_34806812/article/details/82021474
今日推荐