delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/11/23/18:03:21

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
content-class: urn:content-classes:message
MIME-Version: 1.0
X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0
Subject: RE: gcc problem?
Date: Sat, 23 Nov 2002 18:03:10 -0500
Message-ID: <83040F98B407E6428FEC18AC720F5D732DB754@exchange.tropicnetworks.com>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
From: "Rolf Campbell" <rcampbell AT tropicnetworks DOT com>
To: "Carlo Florendo" <carlo AT astra DOT ph>, <cygwin AT cygwin DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id gANN3JP25156

This is not a bug in Cygwin or Gcc.  Scanf("%s", ...) only reads from
the stdin if the input buffer is empty.  If you only enter a single word
on the first prompt, then it will wait for you to type the 2nd word.  If
Borland produces different results then maybe they are wrong (or simply
different).

-Rolf

> -----Original Message-----
> From: Carlo Florendo [mailto:carlo AT astra DOT ph] 
> Sent: Wednesday, November 20, 2002 9:46 PM
> To: cygwin AT cygwin DOT com
> Subject: gcc problem?
> 
> 
> 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)
> 
> 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 );
>    }
>    return 0;
> }
> -----------end snippet-------------
> 
> 
> Thanks!
> 
> ------------------------------------
> Carlo Florendo
> Astra (Philippines), Inc.
> Email: carlo AT astra DOT ph
> Web: http://www.astra.ph
> 
> 
> 
> --
> 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/
> 
> 

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019