| www.delorie.com/archives/browse.cgi | search |
| From: | "A. Sinan Unur" <asu1 AT cornell DOT edu> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: A newbie question: out to print out value of doubles? |
| Date: | Sat, 07 Dec 1996 10:11:41 -0500 |
| Organization: | Cornell University |
| Lines: | 33 |
| Sender: | asu1 AT cornell DOT edu (Verified) |
| Message-ID: | <32A9892D.3AC3@cornell.edu> |
| References: | <32a98413 DOT 1518950 AT news DOT diac DOT com> |
| NNTP-Posting-Host: | cu-dialup-0008.cit.cornell.edu |
| Mime-Version: | 1.0 |
| To: | radams AT mail DOT diac DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Richard Adams wrote:
>
> void main(void)
please don't do this. main is supposed to return an int no matter what
some books tell you.
> {
> double a=3.125978724;
>
>
> printf("The variable a is:\n\t");
> fprintf ("%f\n", &a);
>
> return;
> }
>
> I get an "incompatible pointer type" warning. How can I print out the
> value of a double-precision floating point variable? Any help at all
> will be greatly appreciated...:) Thank you!!
well, fprintf is not fscanf. when you are using the printf functions you
only need to specify the name of the variable.
sinan.
--
*******************************************************************
A. Sinan Unur WWWWWW
|--O+O
mailto:asu1 AT cornell DOT edu C ^
mailto:sinan AT econ DOT cit DOT cornell DOT edu \ ~/
http://www.bqnet.com/sinan/
*******************************************************************
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |