www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/10/19:07:57

From: kagel AT quasar DOT bloomberg DOT com
Date: Tue, 10 Dec 1996 18:49:23 -0500
Message-Id: <9612102349.AA05584@quasar.bloomberg.com >
To: radams AT november DOT diac DOT com
Cc: djgpp AT delorie DOT com
In-Reply-To: <32a98413.1518950@news.diac.com> (radams@november.diac.com)
Subject: Re: A newbie question: out to print out value of doubles?
Reply-To: kagel AT dg1 DOT bloomberg DOT com

   Errors-To: postmaster AT ns1
   From: radams AT november DOT diac DOT com (Richard Adams)
   Newsgroups: comp.os.msdos.djgpp
   Date: Sat, 07 Dec 1996 14:50:02 GMT
   Organization: Denver Internet Access Corp.
   Lines: 26
   Reply-To: radams AT november DOT diac DOT com
   Nntp-Posting-Host: p141.ppp2.diac.com
   X-Newsreader: Forte Free Agent 1.1/16.230
   Dj-Gateway: from newsgroup comp.os.msdos.djgpp
   Content-Type: text
   Content-Length: 684

   Hi. I have a question. I'm new to C. I'm writing an application that
   needs the extra precison of double-length floating point numbers
   rather than the single-precision float type. I'd like to be able to
   print out the double-floating-point variables, but how? I have tried
   the following but it doesn't work:

   #include <stdio.h>
   #include <math.h>

   void main(void)
   {
	   double a=3.125978724;


	   printf("The variable a is:\n\t");
	   fprintf ("%f\n", &a);
                            ^^
Make this:
	  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!!

-- 
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com

A proverb is no proverb to you 'till life has illustrated it.  -- John Keats

- Raw text -


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