c convert char of int to int code example
Example 1: c convert char to int
int i = (int)(c - '0');
Example 2: casting an int to a char in c
Use ASCII chart.
int i=65;
char ch;
ch= (char)i;
printf("Expected value of ch: A. This value is found by using a ASCII chart");
Example 3: c char to int
int i;
char c = 'A';
i = (int)c;