Path: utzoo!attcan!uunet!snorkelwacker!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Need help inputting Float #'s Message-ID: <17124@haddock.ima.isc.com> Date: 19 Jul 90 18:06:19 GMT References: <2834@elrond.CalComp.COM> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Distribution: na Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 22 In article <2834@elrond.CalComp.COM> shodsdon@elrond.UUCP (Steve V. Hodsdon) writes: >In article hart@blackjack.dt.navy.mil (Michael Hart) writes: >>Please respond via E-mail... > >Tried to, can't get there from here :-) Please, folks, don't use USENET as a substitute for faulty mail. If your mailer can't understand the address, then just sit on your hands and let somebody else answer the question. (Especially when your answer is wrong, 'cause then we gurus might have to do damage control.) >> sscanf(buffer,"%f%n",&number,&c1); > ^^ -> should be %lf `%lf' is the correct scanf format for objects of type `double', but (after fixing the bug that he had an extra `*' in all the declarations) the type of the object in question was `float', for which `%f' is indeed correct. (Note that the situation is different for printf, where the context is such that float would promote to double, so `%f' serves for both.) Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint