c - Why shouldn't I use atoi()? -
this question has answer here:
- atoi() — string int 5 answers
someone told me shouldn't use atoi()
, , should use strtol()
instead. what's wrong atoi()
shouldn't use it? strtol()
right thing use instead? (and fact strtol()
returns long
, not int
atoi()
does?)
from own link:
the atoi() function subsumed strtol() retained because used extensively in existing code. if number not known in range, strtol() should used because atoi() not required perform error checking.
or
atoi
obsolete
Comments
Post a Comment