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> atoi<br />

atoi Converts a string to an integer.<br />

#include <br />

int atoi(<br />

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

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

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

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

when a nondigit character is detected. If the first nonwhite space character is not a<br />

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

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

(int) 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-11<br />

3

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

Saved successfully!

Ooh no, something went wrong!