C-introduction and usage example of atoi() function

The atoi() function converts a string into a number.

Examples:

#include<stdlib.h>
#include<stdio.h>

int main()
{ char str[]=“123”; int a; a=atoi(str); / Convert a string into an int type number / printf("%d\n",a);



} The
output is 123

Guess you like

Origin blog.csdn.net/Williamcsj/article/details/107303415