does the code tag work?
std::cout
and lets try a quote aswell
std::cout <
std::cout <
Quote:Original post by electronix
'endl' is system independent, so basically using endl (end-ell) will add the appropriate line break for the operating system it is running on.
'\n' is not system independent, different operating systems may have a different
line break character.
so using 'endl' is the best and 'safer' option.
Quote:Original post by MadDog72
The problem with using '\n' is that it doesn't flush the buffer, so if the program crashes, there may be text still in the buffer that has not been displayed on the screen. This is misleading because you might assume that the error occurred before the text should have been displayed, when really the error occurred after.
#include <iostream>int main(){ using std::cout; using std::endl; cout << "Hello there.\n"; cout << "Here is 5: " << 5 << "\n"; cout << "The manipulator endl writes a new line to the screen."; cout << endl; cout << "Here is a very big number:\t" << 7000 << endl; cout << "Here is the sum of 8 and 5:\t" << 8 + 5 << endl; cout << "Here's a fraction:\t\t" << (float) 5/8 << endl; cout << "And a very very big number:\t"; cout << (double) 7000 * 7000 << endl; cout << "Don't forget to replace Jesse Liberty with your name...\n"; cout << "Jesse Liberty is a C++ Programmer!\n"; return 0;}