I'm going mad trying to figure this out but nothing I try is working. Please help me out here.
char ch[5];
int in = 15;
ch[2] = in; // It has to be on a specefic place in that array
cout << ch[2]; // Prints '*'
I know i can do something like ch[2] = in+48; but that will only work with numbers smaller than 10.
intis bigger thanchar. Are you trying to truncate theintvalue to the size of achar, or split theintup into multiplechar's?char, which basically chops off the high bits and only leaves the eight low bits which happens to be the same value as the ASCII code for'*'.coutto print?15?