Have a look at strtol(), it can tell you about invalid parts of the string by pointer return.
And beware of enthusiastic example code.. see the man page for comprehensive error-handling.
More Related Contents:
- Why does strchr take an int for the char to be found?
- What is the output of the following code in C? [closed]
- pointer to string concept in c [closed]
- Why when i add number to string it shows random text in c++?
- What is the difference between char s[] and char *s?
- Why is this string reversal C code causing a segmentation fault? [duplicate]
- Is the size of C “int” 2 bytes or 4 bytes?
- When should I use ampersand with scanf()
- enum to string in modern C++11 / C++14 / C++17 and future C++20
- How do I create an array of strings in C?
- How does strtok() split the string into tokens in C?
- How to convert enum names to string in c
- Are string literals const?
- Returning string from C function
- How to compare strings in an “if” statement? [duplicate]
- fgets() includes the newline at the end [duplicate]
- Convert Bytes to Int / uint in C
- What is the proper way of implementing a good “itoa()” function?
- What is a “wide character string” in C language?
- Comparing two strings in C? [duplicate]
- Array type char[] is not assignable [duplicate]
- Why does char* cause undefined behaviour while char[] doesn’t?
- Concatenating strings in C, which method is more efficient?
- Varying string variable in an if condition
- String.indexOf function in C
- Does C support raw string literals?
- Does C have any tools for doing string addition?
- How to concatenate string and int in C?
- How to convert char * to BSTR?
- String termination – char c=0 vs char c=’\0′