什么时候的printf无法打印? [英] When does printf fail to print?

查看:221
本文介绍了什么时候的printf无法打印?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C printf函数并不总是在屏幕上打印输出。例如,如果你忘了把\\ n在字符串的结尾你printfing你有时没有得到O / P。是否有一些其他条件时的printf不打印。我记得有人说,有7个这样的条件。你们可以请帮助。

printf function in c doesn't always print the output on screen. For example if you forget to put \n at the end of string you are printfing you sometimes don't get the o/p. Are there some other conditions when printf doesn't print. I remember someone saying that there are 7 such conditions. Can you guys please help.

推荐答案

标准输出是一个缓冲流,它不能保证冲洗,除非换行符被放了进去,流被关闭或程序正常退出。如果程序退出异常,有可能在流不平齐。标准出来是行缓冲,这就是为什么一个换行符将刷新它。有迹象表明,不会换行刷新缓冲区。

Standard out is a buffered stream, it is not guaranteed to flush unless a newline is put in, the stream is closed, or the program exits normally. If the program exits abnormally, it is possible for the stream to not flush. Standard out is line buffered, which is why a newline will flush it. There are buffers that will not flush with a newline.

这篇关于什么时候的printf无法打印?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆