+ 1
How can I solve the problem?
Changing the output of the program from 1,2,3,4,5,6 to A,B,C,D,E,F https://code.sololearn.com/cJUHp6nFITld/?ref=app
2 Réponses
+ 2
A statement as:
int a = (int) 'A';
is a C-like explicit type-cast.
C++ supports this because of its backward compatibility with C. In modern C++ other notations are used:
int a = int ('A'); // functional notation
int a = static_cast<int>('A'); //object notation
http://www.cplusplus.com/doc/tutorial/typecasting/