And the man page (on OS X) has this prototype for strol():
strtol(const char * restrict nptr, char ** restrict endptr, int
I.e., it returns a long. Although some compilers might do the right
thing, conversions should be explicitly shown.
On Apr 18, 2007, at 11:38 AM, Jeff Squyres wrote:
> Because the target variable is an (int). Plus, the man pages on OSX
> and Linux both say that atoi() is the exact equivalent of
> (int)strtol(nptr, (char **)NULL, 10);
> and that atoi() is deprecated (which I didn't know).
> On Apr 18, 2007, at 11:32 AM, Roland Dreier wrote:
>>> With the (int) cast, I'm ok with it now. :-)
>> What's the point of the cast to int?
>> - R.
>> devel mailing list
> Jeff Squyres
> Cisco Systems
> devel mailing list