How many characters does an escape sequence (\On, \Hn, \n, \f) in C++ consume?
2013
How many characters does an escape sequence (\On, \Hn, \n, \f) in C++ consume?
- A.
1
- B.
3
- C.
2
- D.
None of these
Attempted by 256 students.
Show answer & explanation
Correct answer: A
Key point: An escape sequence written in source code (starting with a backslash) is interpreted by the compiler as a single character in a character or string literal. Example: '\n' is two characters in the source (a backslash and 'n') but represents one newline character.