ç标准输出打印,但不换行? [英] c stdout print without new line?

查看:126
本文介绍了ç标准输出打印,但不换行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打印客户端>关于在C标准输出,没有新的生产线。结果
的printf(CLIENT>);结果
不打印enything。
我该如何解决呢?

  INT的main(){
的printf(CLIENT>);
}


解决方案

尝试的 fflush(标准输出); 后您的的printf

您也可以调查 setvbuf用来如果你发现自己叫 fflush 频繁,想避免干脆叫它。请注意,如果你正在写大量输出到标准输出,那么很可能会导致性能下降,使用 setvbuf用来

i want to print "CLIENT>" on stdout in c, without new line.
printf("CLIENT>");
does not print enything. how do i solve this?

int main (){
printf("CLIENT>");
}

解决方案

Try fflush(stdout); after your printf.

You can also investigate setvbuf if you find yourself calling fflush frequently and want to avoid having to call it altogether. Be aware that if you are writing lots of output to standard output then there will probably be a performance penalty to using setvbuf.

这篇关于ç标准输出打印,但不换行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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