#include #include #include #include bool is_float(const char *s, float dest) { if (s == NULL) { return false; } char *endptr; dest = (float) strtod(s, &endptr); if (s == endptr) { return false; } while (isspace((unsigned char ) *endptr)) { endptr++; } return *endptr == '\0'; }