C question - programming?
Is there a function to check if a string is a positive integer in C?
I have tried someone's idea using atoi(), but I found a problem.
Because atoi would return a value that is not zero, even if the string contains some characters in it. E.g. 27abc
atoi would return 27. I just want the function to check if the string is a positive integer with nothing else attached with it. How can I do that? thank you.