I don't know why the code below works? and why is it completed compile?
Code : b = char(a);
I wonder if it's one of the ways to use "char" or if it's a bug.
printf("Start Test\n");
int a = 0xF30;
char b = 0;
char c = 0;
char d = 0x30;
char e = 0xF30;
b = char(a); // <- Why??
c = (char)a;
printf("%c, %c, %c, %c, %c\n", a, b, c, d, e);
printf("End Test\n");
getchar();
return 0;
Console Result
Start Test
0, 0, 0, 0, 0
End Test