P
Pavel Krcmar
Hi,
I'am a little bit confused. I tried this snippet (below) and ( endptr !=
NULL ) is true everytime. I was looking to
http://www.mkssoftware.com/docs/man3/strtol.3.asp
and then to
http://www.cplusplus.com/ref/cstdlib/strtol.html
The second www specifies things like they are done - endptr is not NULL.
Is something wrong?
Best Regards,
Pavel Krcmar
---------------------------------
int main()
{
int i;
const char *z = "345";
char *endptr;
i = strtol( z, &endptr, 10 );
if ( endptr != NULL )
{
printf("endptr is not zero!\n");
printf("%s\n", endptr );
}
printf( "i=%i\n", i );
return 0;
}
---------------------------------
I'am a little bit confused. I tried this snippet (below) and ( endptr !=
NULL ) is true everytime. I was looking to
http://www.mkssoftware.com/docs/man3/strtol.3.asp
and then to
http://www.cplusplus.com/ref/cstdlib/strtol.html
The second www specifies things like they are done - endptr is not NULL.
Is something wrong?
Best Regards,
Pavel Krcmar
---------------------------------
int main()
{
int i;
const char *z = "345";
char *endptr;
i = strtol( z, &endptr, 10 );
if ( endptr != NULL )
{
printf("endptr is not zero!\n");
printf("%s\n", endptr );
}
printf( "i=%i\n", i );
return 0;
}
---------------------------------