What to use endl or "\n"

The difference between std::endl and '\n' is that std::endl actually flushes the stream. This can be a costly operation in terms of processing time, so it's best to get in the habit of only using it when flushing the stream is actually required.

You may also like:
C++: Basic Data Types
C++: Functions -1
C++: Implementation of Quicksort
C++: Implementation of Heapsort
Cool Websites you don't know about...

Popular Posts

Top 10 Web Sites Every Programmer Should Visit Daily

C++: Huffman Coding using STL

What is "namespace" and why do we use it?