X
Xiaoshen Li
Dear All,
I am puzzled by how to use strtod(). I have pasted its man page below. I
don't understand what char **endptr is and why it is needed there.
Thank you very much.
STRTOD(3) Library functions
STRTOD(3)
NAME
strtod, strtof, strtold - convert ASCII string to floating point
number
SYNOPSIS
#include <stdlib.h>
double strtod(const char *nptr, char **endptr);
float strtof(const char *nptr, char **endptr);
long double strtold(const char *nptr, char **endptr);
DESCRIPTION
The strtod, strtof, and strtold functions convert the initial
portion of the string pointed to by nptr to double,
float, and long double representation, respectively.
I am puzzled by how to use strtod(). I have pasted its man page below. I
don't understand what char **endptr is and why it is needed there.
Thank you very much.
STRTOD(3) Library functions
STRTOD(3)
NAME
strtod, strtof, strtold - convert ASCII string to floating point
number
SYNOPSIS
#include <stdlib.h>
double strtod(const char *nptr, char **endptr);
float strtof(const char *nptr, char **endptr);
long double strtold(const char *nptr, char **endptr);
DESCRIPTION
The strtod, strtof, and strtold functions convert the initial
portion of the string pointed to by nptr to double,
float, and long double representation, respectively.