在 C/C++ 中 printf 到 stderr
问题:
你想使用 printf 将某些内容打印到 stderr 流(而不是 stdout)
解决方案
使用 fprintf(stderr, ...)
例如使用
stderr_example.c
fprintf(stderr,"Senselessly printing %d\n",128);而不是
printf_example.c
printf("Senselessly printing %d\n",128);Check out similar posts by category:
Allgemein
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow