473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

how flushing standard io

I have some printf statements in my code and they arnt printing out. They
only print out with \n on the end. That tells me i need to flush the
buffer. But i dont know how.
I am using gcc and linux, dont know if that matters
Nov 14 '05 #1
3 1762
"Robert Smith" <no**@none.com> writes:
I have some printf statements in my code and they arnt printing out. They
only print out with \n on the end. That tells me i need to flush the
buffer. But i dont know how.


fflush(stdout);
--
"The way I see it, an intelligent person who disagrees with me is
probably the most important person I'll interact with on any given
day."
--Billy Chambless
Nov 14 '05 #2
"Robert Smith" <no**@none.com> wrote:
# I have some printf statements in my code and they arnt printing out. They
# only print out with \n on the end. That tells me i need to flush the
# buffer. But i dont know how.
# I am using gcc and linux, dont know if that matters

You can use setvbuf(stream,0,_IONBF,0) to turn off buffering.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
Wow. A sailboat.
Nov 14 '05 #3
On Mon, 06 Sep 2004 01:12:27 GMT, "Robert Smith" <no**@none.com>
wrote:
I have some printf statements in my code and they arnt printing out. They
only print out with \n on the end. That tells me i need to flush the
buffer. But i dont know how.
I am using gcc and linux, dont know if that matters


Look up the fflush function.
<<Remove the del for email>>
Nov 14 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: micha | last post by:
whenever an error occurs after ob_start() the buffer is flushed and the content printed. 1. is that standard behaviour? 2. if yes, how to prevent it? micha p.s. i can't use my own error...
2
by: Graham Ashton | last post by:
Hi. I'm having trouble flushing sys.stdout. I've written a small example to illustrate my problem (see below). In short, I expect it to ping "received hello", sleep for 5 seconds and then print...
6
by: Farshid Lashkari | last post by:
Hi, My application has python embedded into it. I noticed that when I run any python code the output is buffered and doesn't get flushed until my application exits. To fix this I simply flush...
3
by: gf gf | last post by:
Is there any way to make Python's print() flush automatically, similar to...mmm...that other language's $|=1 ? If not, how can I flush it manually? sys.stdout.flush() didn't seem to work. ...
6
by: g pavlov | last post by:
W3C recommendations notwithstanding (see http://w3.org/TR/html401/appendix/notes.html#notes-tables) I can't seem to persuade either of the leading browsers to do true incremental table loading....
5
by: Christopher Benson-Manica | last post by:
Yes, it's me again, with my dear, dear friends std::streambuf and std::ostream... On the bright side, the code compiles. On the gloomy side, I can't seem to get overflow() or xsputn() called... ...
3
by: Eric | last post by:
Good afternoon, Can anyone help me with flushing the buffer in ASP.NET. I have a set of functions that perform a series of maintainence operations. As these functions are called sequentially,...
8
by: CJM | last post by:
I have quite a large report, which takes a couple of minutes to run. I'd like to show line-by-line updates as they become available, but since I'm using IE6, Response.Flush() doesnt work. I know...
5
by: arnuld | last post by:
this is from mentioned section. i did not understand some things here: it means "flushing the buffer" and "writing to output device" are SAME thing, these are just 2 different names for the...
12
by: jamik | last post by:
What is the meaning of "flushing the standard output"?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.