Escape Sequences - C++ Language Basics

C++ examples for Language Basics:Hello World

Introduction

Escape Sequence Character
\nNewline
\tHorizontal tab
\v Vertical tab
\bBackspace
\rCarriage return
\fForm feed
\a Alert
\\Backslash
\?Question mark
\'Single quotation
\"Double quotation
\nnn Octal number
\xhhhhHexadecimal number
\0Null character

Demo Code

#include <iostream>
using namespace std;
int main()/*from w  w w  .j a  v  a  2 s  . c om*/
{
   cout << "Computers\n, computers \teverywhere";
   cout << "\n as far as I \'\"can \\C";
   return 0;
}

Result


Related Tutorials