6
66650755
First,thanks for all who have answered my last question.
if char string[20]="12345";
how could I convert the string[2](that is "3") to an int by using
atoi? I only want to convert string[2],not other string.
I've written these sentences:
int a;
char string[7]="111111";
a=atoi(string[3]);
however,the compiler said:
error C2664: 'atoi' : cannot convert parameter 1 from 'char' to 'const
char *'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast.
I'm eager to find an solution.thinks,thinks,thinks!!
if char string[20]="12345";
how could I convert the string[2](that is "3") to an int by using
atoi? I only want to convert string[2],not other string.
I've written these sentences:
int a;
char string[7]="111111";
a=atoi(string[3]);
however,the compiler said:
error C2664: 'atoi' : cannot convert parameter 1 from 'char' to 'const
char *'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast.
I'm eager to find an solution.thinks,thinks,thinks!!