string be converted to a number

The function takes the string as an input that needs to be converted to an integer.

int atoi(const char *string)

Return Value:

On successful conversion, it returns the desired integer valueIf the string starts with alpha-numeric char or only contains alpha-num char, 0 is returned.In case string starts with numeric character but is followed by alpha-num char, the string is converted to integer till the first occurrence of alphanumeric 
Posted on by