Or maybe just stick to strtol, strtoul, and strtod. They'll do a much better job at detecting valid numeric sequences, not to mention taking care of copying the value into an actual variable.
Printable View
You know , yes you are right , putting all the format specifiers in the first argument of printf() is sucks , its faster to do as you showed.