jeudi 29 juillet 2021

Can someone tell me the output and provide explanation of the following c++ code?

cout<<"#" + 'a'<<endl;

string s = "#";
s += 'a';
cout<<s<<endl;

I am not able to figure out how the typecasting is working in the case "#" + 'a'

Aucun commentaire:

Enregistrer un commentaire