Mail Archives: djgpp/1998/09/07/19:54:48
> Arthur wrote:
> > > > line in C, you use \n. In C++ you can use endl, but it's not
> > > necessary. It
> > > > does have it's uses.
> > > You can still use '\n' in C++.
> > If you want to be nostalgic, yes. :^)
> It is frequently easier to use \n.
>
> cout << "Hello.\n";
> cout << "Hello." << endl;
It's true use is if you do something like this:
cout << "Hello, this is a number: " << number << endl;
as opposed to:
cout << "Hello, this is a number: " << number << "\n";
It's (very slightly) quicker than typing "\n"; and is more legible. It
amounts to the same thing when compiled, though.
James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819
- Raw text -