C Program to cast char to int
#include <stdio.h> int main(){ char c = '1'; int i = c - '0'; printf("%d\n",i); printf("Size of i is %ld",sizeof(i)); return 0; }
1 Size of i is 4
The size of i will be 4 since it was casted to int.
Comments :