In the C Programming Language, the atoi characteristic converts a string to an integer.
The atoi feature skips all white-space characters at the starting of the string, converts the subsequent characters as section of the number, and then stops when it encounters the first personality that is not a number.
The syntax for the atoi function in the C Language is:
int atoi(const char *nptr);
Parameters or Arguments
nptr A pointer to a string to convert to an integer.
The atoi feature returns the integer representation of a string. The atoi feature skips all white-space characters at the beginning of the string, converts the subsequent characters as phase of the number, and then stops when it encounters the first character that isn’t always a number.
In the C Language, the required header for the atoi feature is:
In the C Language, the atoi function can be used in the following versions:
Other C features that are similar to the atoi function:
atof characteristic atol function strtol feature strtoul characteristic
Other C functions that are noteworthy when dealing with the atoi function:
strtod function <stdlib.h>