Well, you could loop byte by byte and call isdigit() function.

-----Original Message-----
Subject: [C400-L] Validating Numeric values

C is not my 'native' language, so I'm asking what the most efficient way
to validate a string as containing a numeric value is.  The ato?() and
sscanf() functions just stop when they encounter a non-numeric, but do
not tell you that they did.  

I need to verify that a string contains a valid numeric value.  (I.E. "
+100" not "1 + 00" nor even "1+00  ", let alone "BOB   ")  (ato?() &
sscanf() would return NULL or 1 in each case.)

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].