if(freopen("e:\\lstm-comparec\\lstm\\lstm\\output.txt","a",stdout)==NULL)
fprintf(stderr,"errorredirectingstdout\n");
fclose(stdout);
重新打开:文章地址https://www.yii666.com/article/756317.html
windows:
freopen("CON", "w", stdout);
linux
freopen("/dev/stdout","w",stdout);
网址:yii666.com2011-09-26 22:24 672人阅读 评论(0) 收藏 举报
eclipsecbuffer终端null
在ecplise下使用cdt开发c程序,发现运行后终端没有输出,停止后会输出,通过在main中添加
setbuf(stdout,NULL);
解决问题,原来是因为默认输出流存在buffer机制,通过上面语句, 取消buffer文章来源地址:https://www.yii666.com/article/756317.html
更多0
- 上一篇Eclipse+CDT+MinGw+gdb
- 下一篇mini2440 SPI驱动移植
fflush(stdout);