Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to separate the numbers in a string into numbers and store them in an integer array in C language?
How to separate the numbers in a string into numbers and store them in an integer array in C language?
This function can be realized by using the function atoi.

# include & ltstdlib.h & gt

# include & ltstdio.h & gt

void main()

{

char str[]= " 123 ";

int n;

n = atoi(str);

printf("%d\n ",n);

}