Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
man strtod
#include <stdio.h>
#include <stdlib.h>
int
main(int argc, char *argv[])
{
char input[256];
while ((void)fprintf(stdout, "Enter a float number :"),
fgets(input, sizeof(input), stdin) != (char *)(NULL))
{
char *endptr;
double value = strtod(input, &endptr);
if ((endptr[0] == '\0') || (endptr[0] == '\n'))
(void)fprintf(stdout, "Double number read : %lf\n", value);
else
(void)fprintf(stdout, "garbage characters found: %s\n", endptr);
}
return 0;
}