delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/07/19:54:48

Reply-To: <arfa AT clara DOT net>
From: "Arthur" <arfa AT clara DOT net>
To: "DJGPP Mailing List" <djgpp AT delorie DOT com>
Subject: RE: Why doesn't C++ work!?!?!
Date: Tue, 8 Sep 1998 00:27:48 +0100
Message-ID: <000901bddab7$1fedf240$964d08c3@arthur>
MIME-Version: 1.0
In-Reply-To: <35F44D81.FEF6FB7D@unb.ca>
Importance: Normal

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


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019