#include <stdlib.h>int atoi(const char *str);

The atoi( ) function converts the string pointed to by str into an int value. The string must contain a valid integer number. If this is not the case, the returned value is undefined.

The number can be terminated by any character that cannot be part of an integer number. This includes whitespace, punctuation, and characters. This means that if atoi( ) is called with “123.23”, the integer value 123 will be returned, and the “.23” is ignored.

Related functions are atof( ) and atol( ).

C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539 © 2008-2017.
If you may any questions please contact us: