i dont understand what the function "flush" does
please answer
and one more,
is there a way that we output a set of data
only after a certain while in program execution
without storing it in a file and again
printing it after reading from that file
eg....
i declared a variable 'va'
in c++ code ..the value of va changes based upon
the input given by user which is done many times in program
and i like to print the value of va many times in program
but,only after the user is satisfies with his number of inputs
so i need to output all the values va all at a time at the only at the end
tnvkrishna
0
Light Poster
Recommended Answers
Jump to PostThe flush function forces data to be written to a disk data file (or some other output stream).
There is a couple ways I can think of to solve your problem:
1. write each value to a file then read the values back and display them when the user …
Jump to Post>but using cout or any object of ofstream also makes the data to be outputted
You're mixing things up. Any object derived from ostream contains a buffer. It's this buffer that "makes the data to be outputted", and when it sends characters from the buffer to the destination (the destination …
Jump to Post> ........increasing the capacity that the buffer can hold
lookup std::basic_ios<>::rdbuf and std::basic_streambuf<>::pubsetbuf> .........by "removing any ties" that the ostream object has
calling std::basic_ios<>::tie(0) will remove any tie.
All 10 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
tnvkrishna
0
Light Poster
Narue
5,707
Bad Cop
Team Colleague
tnvkrishna
0
Light Poster
vijayan121
1,152
Posting Virtuoso
tnvkrishna
0
Light Poster
Narue
5,707
Bad Cop
Team Colleague
tnvkrishna
0
Light Poster
Narue
5,707
Bad Cop
Team Colleague
vijayan121
1,152
Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.