Character Code in C++

Level 125 keystrokes

Casts the character 'A' to int and prints its character code, 65.

C++ code

// (int)'A' is a C-style cast that turns the char into its numeric code
// In ASCII the uppercase letter A has code 65, so 65 is printed instead of A
1cout << (int)'A' << endl;

Output

65
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this C++ code and how often they appear.

  • <× 4
  • '× 2
  • ;× 1
  • (× 1
  • )× 1

More C++ examples at level 1

← C++ typing practice