Hi, I'm new to C++. Anyway, what's the point of using endl when you can use \n?
Hi, I'm new to C++. Anyway, what's the point of using endl when you can use \n?
run a search.
click here your search is done for you.
That raises some new questions: what's the point of typing std::cout instead of cout?
Also, what does "flushes the output buffer" mean?
>Also, what does "flushes the output buffer" mean?
Flushing the output buffer empties the buffer onto the screen.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
>>what's the point of typing std::cout instead of cout?
http://faq.cprogramming.com/cgi-bin/...&id=1043284351
>>what does "flushes the output buffer" mean?
Output from your program can sometimes be buffered before it is actually displayed on the screen, or written to the file (depending on where it's going). Using a flush routine tells the OS to move the data from the buffer to its destination now, rather than letting the OS decide when to do it for you.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
Yeah, I've had information displayed in the wrong sequence, or even wait until main() ends before it was displayed. This was when using \n in a windows console application.now, rather than letting the OS decide when to do it for you.