delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/06/12:11:10

Date: Mon, 6 Dec 1999 15:58:45 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Jason Yip <manman AT netteens DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: Whatever the input, the output is always 0
In-Reply-To: <82gbc8$gq0$1@imsp026.netvigator.com>
Message-ID: <Pine.SUN.3.91.991206155642.21067D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 6 Dec 1999, Jason Yip wrote:

> whatever I input, say 4.0 5.0, the output is always =0 . why??
[snip]
> scanf("%lf%lf",a,b);

Re-read the docs of `scanf': it needs a *pointer* to the variables whose 
values you want to read.  So you need to say this:

	scanf("%lf %lf, &a, &b);

(Note the blank between the format descriptors: it's also important in 
some cases.)

- Raw text -


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