From: dbe AT wgn DOT net ($Bill Luebkert) Subject: Re: B20.1 Automatic carriage return 31 Dec 1998 18:56:11 -0800 Message-ID: <368C054A.EA71990A.cygnus.gnu-win32@wgn.net> References: <199812311751 DOT LAA29148 AT modi DOT xraylith DOT wisc DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Mumit Khan Cc: Cheung Chi Man , gnu-win32 AT cygnus DOT com Mumit Khan wrote: > > "Cheung Chi Man" writes: > > I use Cygwin B20.1, under WIndows 95, to compile my C++ program. > > However, I found that a carriage return occur even if I have no > > intention to do. > > For example, my program (test.cpp): > > #include > > void main() > > { int number; > > cout<<" Please input a number "; > > cin>>number; > > cout< > } > > When I compile it and run the prgram, it occur as follow : > > ------- screen shot ------- > > BASH.EXE-2.02$g++ -o test test.cpp > > BASH.EXE-2.02$./test.exe > > Please input a number > > 13 > > 13 is your input number BASH.EXE-2.02$ > > ------- screen shot end ------ > > It automatically make a carriage return !! Is there something > > worng ? > > > > The carriage return comes from when you hit after you enter the > number. > > It's not a bug, but expected behaviour. To do otherwise, ie., to swallow > the , you need to use one of the terminal packages (eg., curses). I'm not positive, but I think he's referring to the before the 13, not after. The one after "number". My guess is he wanted the number to be input on the same line as the prompt. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / ) // // DBE Collectibles http://www.wgn.net/~dbe/ / ) /--< o // // Mailto:dbe AT wgn DOT net V3: http://come.to/dbe -/-' /___/_<_