I want to convert a number from char * to a 32 bit integer int32_t, but strtol () returns long.
I do not know the long length of my car. It could be 32 or 64 bits or something else in the future.
What is the correct and bulletproof way to convert a string to a 32 bit integer int32_t? Or to convert long to int32_t.
Comparison with the _MAX and _MIN constants in the only and easiest way?
source
share