I have a question regarding atoi. I am trying to use atoi to check if I can convert a character into a number, however, if my number is 0 how do I get around that? I understand that atoi returns 0 if it fails, but also returns the value of the number if it works, in which case 0 would fall under both categories.
If I were to use strtol instead, is there a way to check if the character in an array is >= to 0, or isn't/doesnt exist at all.
For instance, if my dynamic array consisted of {1 40 500}, and I try to strtol at position 8 (just out of bounds), I would like it to return NULL or some indication that atoi/strtol failed