int atoi (const char *nPtr)
This function change "*nPtr" into a int, and return this int.
For example:
---------------------------------------------------------------------
#include<stdio.h>
#include<stdlib.h>
int main(){
char string[6]="12345";
int num[6]={0};
num[1] = atoi(&string[0]);
num[2] = atoi(&string[1]);
printf("%d\n",num[1]);
printf("%d\n",num[2]);
return 0;
}
-----------------------------------------------------------------------
It's output is:
----------------------------------------
12345
2345
--------------------------------------
but how can I use "atoi" to use num[1] store the first "1" and use num[2]
store the "2" ?
---------------------------------
@yahoo.cn 新域名、无限量,快来抢注!
[Non-text portions of this message have been removed]