Hi,
I am confused about the call and the return vals. The defn, says:
-------------------
double strtod(const char *nptr, char **endptr)
RETURN VALUES
The strtod function returns the converted value, if any.
If endptr is not NULL, a pointer to the character after
the last character used in the conversion is stored in the
location referenced by endptr.
If no conversion is performed, zero is returned and the
value of nptr is stored in the location referenced by
endptr.
If the correct value would cause overflow, plus or minus
HUGE_VAL is returned (according to the sign of the value),
and ERANGE is stored in errno. If the correct value would
cause underflow, zero is returned and ERANGE is stored in
errno.
-------------------
So if nptr="1000 00 junk", then the return value must be 0 and the
expression (*endptr == nptr) must be true, right? I am not able to emulate
this. What am I missing?
Thanks,
-Karthik.