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...