This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: B20.1 Automatic carriage return
- To: "Cheung Chi Man" <cheung_chi_man at hotmail dot com>
- Subject: Re: B20.1 Automatic carriage return
- From: Mumit Khan <khan at xraylith dot wisc dot edu>
- Date: Thu, 31 Dec 1998 11:51:10 -0600
- cc: gnu-win32 at cygnus dot com
"Cheung Chi Man" <cheung_chi_man@hotmail.com> 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 <iostream>
> void main()
> { int number;
> cout<<" Please input a number ";
> cin>>number;
> cout<<number<<" is your input number";
> }
> 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 <cr> after you enter the
number.
It's not a bug, but expected behaviour. To do otherwise, ie., to swallow
the <cr>, you need to use one of the terminal packages (eg., curses).
Regards,
Mumit
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".