Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++ Subject: Re: cin - Why Does It Require 2 Returns? Date: Tue, 23 Aug 2011 07:34:52 +1200 Lines: 17 Message-ID: <9bfpasFs5qU1@mid.individual.net> References: <9bbitnF5rnU1@mid.individual.net> <9bdj8eFr0aU3@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net 11Y01wprwOfyVwyZkVueMg6Nzu6NRf08P5HabySkkagqs5Ddsj Cancel-Lock: sha1:V3sBmFc5ZP5QrdY3BurfcXpTKVE= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:9190 On 08/23/11 06:22 AM, Stefan Ram wrote: > Ian Collins writes: >> On 08/22/11 10:19 AM, Eugén Jung wrote: >>> On 21/08/11 06:20, Ian Collins wrote: >>>> using endl rather then \n would be better. >>> Any particular reason (other than std::endl flushing the output buffer)? >> Just flushing the output buffer. > > Flushing takes time. That's exactly why buffering was > invented. So, in C++, one flushes only when it is necessary. > Flushing ::std::cout immediately before a program ends > is not necessary. Until the program grows and the user wonders why the line does not appear. -- Ian Collins