This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: g++ iostream broken on windows 2000


> From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com]On Behalf
> Of Robert Collins

> Oh, and in your output, get rid of the \n, use
> cout << "foo" << endl;

Now, this is off topic, it belongs in nntp://comp.sys.lang.c++ or some
such... but anyway:


To make it more verbose:
 This makes your code easier to port (take to other environments).

End of line, i.e. \n and \r in combinations, depends on which OS you are
using... "endl" is always right.

BTW: I find code that looks like this a lot more readable:

        cout
		<< "Welcome to C++" 		<< endl
            << "Hope you learn a lot" 	<< endl
		;

But, I guess, this might cause some sensitive people to start grumblin' ;-)

Ref:
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=%2B%22c%2B%2B%22+%2B%
22white+space%22+%2B%22formatting%22+%2B%22code%22
e.g. http://www.osdata.com/topic/language/cplus.htm ("C++", third link from
the googling above)

/Hannu E K Nevalainen, B.Sc. EE - 59°16.37'N, 17°12.60'E
-- UTC+1, GMT+1, CET --
--END OF MESSAGE--


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]