Backslash Output in C++

Level 128 keystrokes

Prints the Windows-style path C:\Users, writing the backslash as \\ in the literal.

C++ code

// A single backslash starts an escape sequence, so a literal backslash is written \\
// "C:\\Users" therefore prints as C:\Users
1cout << "C:\\Users" << endl;

Output

C:\Users
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
  • \× 2
  • ;× 1
  • :× 1

More C++ examples at level 1

← C++ typing practice