RE: [Dev-C++] possible bug of MinGW compiler
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ya...> - 2001-10-20 21:19:44
|
This line is being executed till it meets EOF: while ((c =3D getc(input)) !=3D EOF) That means it is being executed until you press ctrl-z in windows systems. If you want to be executed per input try using '\n' too. This is how it worked for me: C:\c>temp sdaff ^Z n =3D 6 stdin C:\c> Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Luigi Santillo > Sent: Saturday, October 20, 2001 4:14 PM > To: dev...@li... > Subject: [Dev-C++] possible bug of MinGW compiler >=20 >=20 > Hi all, >=20 > I tried the small program named "test.exe" (source is "test.c" and is=20 > attached to this message) using the file "in.txt" (also=20 > attached) as its input. >=20 > I have used the MinGW compiler shipped with Dev-C++ 4.0 (the=20 > output of the=20 > command: "gcc -v" says "gcc version 2.95.2 19991024=20 > (release)"), to build=20 > the executable on a Win98 SE equipped system. >=20 > To my surprise, I found that when the input of "test.exe"=20 > comes "directly"=20 > from stdin (I mean without redirection) there is no output!=20 > As usual on DOS=20 > systems, I used Ctrl+z to type EOF. >=20 > The program works as expected when input comes from a file or=20 > "indirectly"=20 > from stdin. >=20 > Is there something wrong in the program or is it a bug of the=20 > compiler? >=20 > Thank you for your attention. >=20 > -- > gisan > gi...@li... >=20 |