Hello I know it was asked many times but I hadn\'t found answer to my specific question.
I want to convert only string that contains only decimal numbers:
Fo
The simplest way that makes error checking optional that I can think of is this:
char *endptr; int x = strtol(str, &endptr, 0); int error = (*endptr != '\0');