char c = ' B
int a;
a =(int)c; ?
If the characters "0" to "9" are converted to 0-9.
char c = ' 8
int a;
a =(int)(c-' 0 '); ?
2. If it is a string of numbers, use atoi and atol.
Supplement:
1, if the number string can use itoa.
# include & ltstdlib.h & gt
# include & ltstdio.h & gt
int main()
{ int number = 123456;
char string[25];
Itoa (number, string,10);
Printf("integer = %d string = %s\n ",number, string);
Returns 0; }