06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

pREPC+ <strong>System</strong> <strong>Calls</strong> atol<br />

atol Converts a string to a long integer.<br />

#include <br />

long atol(<br />

const char *nptr /* string */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

The atol() function converts the initial part of the string pointed to by nptr to a<br />

long int representation. Leading white spaces are ignored. The conversion<br />

terminates when a nondigit character is detected. If the first non-whitespace<br />

character is not a digit, a value of 0 is returned.<br />

Except for the behavior on error, this call is equivalent to:<br />

strtol(str, (char **)NULL, 10);<br />

nptr Points to the string to be converted.<br />

This function returns the converted value. If an error occurs, errno is set to<br />

indicate the condition.<br />

Refer to Appendix B.<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 3-13<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!