Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
From: swamp-dog@ntlworld.com (Guy Harrison)
To: <cygwin@cygwin.com>
Subject: Re: gcc problem?
Date: Sun, 24 Nov 2002 17:20:29 GMT
Message-ID: <3de10a42.288810337@smtp.ntlworld.com>
References: <01ca01c29108$2fe1faa0$437517d2@astra03>
In-Reply-To: <01ca01c29108$2fe1faa0$437517d2@astra03>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id gAOHL8R16672

On Thu, 21 Nov 2002 10:46:26 +0800, "Carlo Florendo" <carlo@astra.ph>
wrote:

>Hello,
>
>Ever since I installed a newer cygwin, I've encountered problems which I
>didn't encounter before.  First, there was the
>"ls -l"problem which has not yet been resolved (and which is threaded as "ls
>problem" in this list.).  Just today, i discovered something wrong while
>using gcc.  I  compiled the snippet below and it's supposed to prompt me for
>input twice.  However, I only get prompted once.  (Using the visual c++
>compiler, the borland 5.5 compiler gives the correct results)

The reverse is true for the example below: ie you were encountering
problems before, but not realising it.

>My gcc version is 2.95.3-5.
>Cygwin version is The cygwin1.dll version I am using is
>1.3.15-cygwin-1-3-15-1.
>
>-----------begin snippet-------------
>#include <stdio.h>
>int main()
>{
>   int n;
>   char string[80];
>   for ( n=0 ; n<2 ; n++ )
>   {
>     printf( "Enter some words: " );
>     scanf( "%s", string);
>     printf( "The first word you entered is : %s\n", string );
>     fflush ( stdin );
^^^hint: "while('\n'!=getchar());"
>   }
>   return 0;
>}

You can't flush(stdin). Nothing wrong with Cygwin here, simply the other
compilers implementing stuff that isn't part of the language. The FAQ
for comp.lang.c or alt.comp.lang.learn.c-c++ will no doubt give you
ample insight.


-- 
swamp-dog@ntlworld.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

