[other] 水,错误输出 (stderr)
Tofloor
poster avatar
wlly-lzh
deepin
2024-05-06 22:27
Author

水,错误输出


stdinstdoutstderr是一组在编程中比较常见的概念。

但是部分人可能对 stderr没有什么概念,包括我。

最近在学习 重定向这部分的知识时,偶然了解了一下。

出于好奇,研究了如何在编程时使用错误输出。

C语言为例:

#include 
int main()
{
    fprintf(stderr,"Error!\n");
}

以上代码会输出一段内容为 Error!的错误输出。

其实一般情况下用不到错误输出,就当是个冷知识吧。

Reply Favorite View the author
All Replies
jjcui8595
Moderator
2024-05-07 07:48
#1

积极探索总是好的like

Reply View the author
dgmenghuan
deepin
2024-05-07 08:19
#2

除了python就是linux了,你这发的

Reply View the author
longzhx
deepin
2024-05-07 09:43
#3

“一般情况下用不到错误输出”可以证伪

Reply View the author