How to Link 2 Source Code Files with C Programming
How to Do Simple Arithmetic with C Programming
Basics of String Functions for C Programming

C Language Escape Sequences

When you're programming in the C language, sometimes you need to refer to a key press that doesn't result in a specific character. Other times, you need to refer to a specific character literally that normally has a different meaning in C. In either case, you need an escape sequence. The following table lists the escape sequences you need to program in the C language.

Escape sequences always begin with a backslash.

Escape Sequence Character
\a Bell (speaker beeps)
\b Backspace (non-erase)
\f Form feed/clear screen
\n New line
\r Carriage Return
\t Tab
\v Vertical tab
\\ Backslash
\? Question mark
\' Single quote
\" Double quote
\xnn Hexadecimal character code nn
\onn Octal character code nn
\nn Octal character code nn
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Declaring Variables in C
C Language Comparisons and Their Opposites
Basics of Arrays for C Programming
Basics of Variable Storage for C Programming
How to Work with Empty char Arrays in C Programming