int d=9;
char g;
g=d+'0';
cout<<g;

I want to know why the above works and dispalys 9;

but the one below do not display 9; although compiles fine, can't we typecast the int to char

int d=9;
char g;
g=char(d);
cout<<"kk"<<g;

thank you