delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/04/02/07:59:12

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
Message-ID: <20020402125832.97267.qmail@web9601.mail.yahoo.com>
Date: Tue, 2 Apr 2002 04:58:32 -0800 (PST)
From: James Merritt <jamesem_99 AT yahoo DOT com>
Subject: Re: trouble using scanf on double arguments under Windows2000
To: cygwin AT cygwin DOT com
In-Reply-To: <F1426496E4A8D411A04A0000D11E0BF9149509@bell.csd.de>
MIME-Version: 1.0

Hi Dr. Sonnenschein and the Cygwin newsgroup,

I have had the same problem using cygwin and gcc, I
believe I am using the latest version of gcc.  I
thought I was doing something wrong in my program, but
I took the same program into Linux, Visual C++ and
HPUX 10.20 and they ran exactly the way they are
supposed to run with the correct results.  My program
was using input from the user instead of from a file,
but my results were exactly the same as the output
from your sample program.  I finally gave up on Cygwin
and gcc and write my programs on a couple of old HP-UX
10.20 workstations with the latest gcc and have no
problems.

I like Cygwin and will continue to support it and
would like to continue playing with it and writing
programs under Cygwin.  I do not want to blame gcc or
Cygwin because I like them, but I want to know what is
causing this behavior as well and is there a
workaround.

Thank you and have a nice day!

James E. Merritt

--- "Sonnenschein, Roland Dr." <sonne AT csd DOT de> wrote:
> scanf() does not always work the way I think it
> should.
> 
> Sample program:
> 
> #include <stdio.h>
> 
> int main()
> {
>   double dstat, ddyn;
>   dstat=2.;
>   scanf("%lf", &ddyn);
>   printf("%lf %lf\n", dstat, ddyn);
>   return 0;
> }
> 
> usage:
> hugo <hugo.in >hugo.out
> 
> Sample input file hugo.in:
> 20.1
> 
> Output file hugo.out:
> 2.000000 201.000000
> 
> compilation:
> make hugo
> 
> gcc -v yields:
> Reading specs from
> /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-4/specs
> gcc version 2.95.3-4 (cygwin special)
> 
> 
> Dr. Roland Sonnenschein
> Abt. BV1TEF
> Brüel & Kjaer Vibro GmbH
> Landwehrstraße 55
> D-64293 Darmstadt
> Tel.: +49(0)61 51 - 32 18 99
> Fax: +49(0)61 51 - 32 18 69
> Email: sonne AT csd DOT de
> 
> --
> 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/
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://http://taxes.yahoo.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/

- Raw text -


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