fprintf中使用stderr

Posted puwen

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了fprintf中使用stderr相关的知识,希望对你有一定的参考价值。

fprintf是C/C++中的一个格式化写—库函数,位于头文件<stdio.h>中,其作用是格式化输出到一个流/文件中

运行如下代码:

#include <stdio.h>

void main( void )
{
   fprintf(stderr, "%s:%d
", __FILE__, __LINE__);
   system("pause");
}

将显示
技术分享图片


以上是关于fprintf中使用stderr的主要内容,如果未能解决你的问题,请参考以下文章