若该文为原创文章,未经允许不得转载
原博主博客地址:https://blog.csdn.net/qq21497936
原博主博客导航:https://blog.csdn.net/qq21497936/article/details/102478062
本文章博客地址:https://blog.csdn.net/qq21497936/article/details/108546564

红胖子(红模仿)的博文大全:开发技术集合(包含Qt实用技术、树莓派、三维、OpenCV、OpenGL、ffmpeg、OSG、单片机、软硬结合等等)持续更新中…(点击传送门)

Qt开发专栏:各种问题解决(点击传送门)

 

问题

开发时,一些常用的c库,如ffmpeg等,其自带的log和协助的调试信息输出是使用printf输出的。

 

原因

printf写入缓冲区没有输出

 

解决方法

1.设置缓存区,为0,这样就会直接输出了

setbuf(stdout, NULL);

2.刷新缓存区

fflush(stdout);

 

原博主博客地址:https://blog.csdn.net/qq21497936
原博主博客导航:https://blog.csdn.net/qq21497936/article/details/102478062
本文章博客地址:https://blog.csdn.net/qq21497936/article/details/108546564

本文地址:https://blog.csdn.net/qq21497936/article/details/108546564