Need help inputting Float #'s

Steve V. Hodsdon shodsdon at elrond.CalComp.COM
Thu Jul 19 03:10:50 AEST 1990


In article <hart.648221206 at blackjack> hart at blackjack.dt.navy.mil (Michael Hart) writes:
#
#Yes, this is probably a stupid, obvious (RTFM) 
#question to all you C geniuses, but, I have
#RTFM and the FM is not very explicit.  What
#a surprise.
#
#I am trying to input a floating point number into
#my prog, in the format nnnnnn.mm .  Using the following
#code, I see that it is reading the correct number 
#of chars, but apparantly either is not storing them
#the way I want, or just not printing them out.
#
#Please respond via E-mail; that way I won't get too
#many flames for this question.

Tried to, can't get there from here :-)

#thanx
#
#code follows:
#=======================================
#[...>
#        sscanf(buffer,"%f%n",&number,&c1);
                        ^^
                           -> should be %lf

#[...]>
#========================================
#
#-- 
#-------------------------------------------------------------------------------
#Michael G. Hart   hart at blackjack.dt.navy.mil /  mhart at dtrc.dt.navy.mil
#DTRC/DoD			  |  "Wherever you go, there you are."- me
#DISCLAIMER: If you want the Navy's opinion, talk to Secretary Cheney.

This is a mistake that I make all the time, also. Someday...

-- 
			    Steve Hodsdon
	  CalComp Display Products Division, A Lockheed Co.
		  65 River Rd, Hudson, NH 03051-0908
shodsdon at elrond.CalComp.COM   (603) 885-8324   {decvax|harvard}!elrond!shodsdon



More information about the Comp.lang.c mailing list