doesn't take numbers
Linas Vepstas
linas@linas.org
Tue, 31 Jul 2001 14:31:35 -0500
On Tue, Jul 31, 2001 at 03:07:19AM -0400, James LewisMoss was heard to remark:
> James> [root@grizzly test]# foo sscanf failed [root@grizzly test]#
>
> In the foo.c file can you change the %lld to %qd and try to run it
> again?
No one ever likes this when I say it, but ... in my experience,
sscanf never quite works as well as one might think it should.
By contrast, finding the begining of a numeric string and passing it
to atof, atod, atoll in this case, always works like a charm.
Note you don't have to terminate; if there is ascii garbage following
the string, its ignored.
--linas
--
I'm very PUBLIC-MINDED, I'm helping a NIGERIAN get his $25,000,000 back!