How do I know whether a return value of 0 from strtol() indicates an error, or simply that the input string was "0"? If string parsing is necessary, this becomes a hassle, so hopefully that's not my only option.
For example, I tried the following, but the return value and errno are the same in each case, so that's no help.
strtol return 0 both if input was bad or it was an actual "0".
If you are using C++ you can try stringstreams to perform conversions, so you can check yourself whether it was successful http://www.cplusplus.com/articles/numb_to_text/