Introduction To C++

C++ is an object oriented programming language. In this we have a special structure type 'class'. In this 'class', both data and functions are embedded. This is a special structure type provided in 'C++'. Classes will provide abstracts. Objects of the classes can be created to work with. We will be discussing about the classes in detail in this course later.

Let us start from the basics of C++

The set of legal characters of ‘C++’ can contribute a legal word in ‘C++’. The set of such characters is referred as Character set of ‘C++’.

The characters are grouped as follows:-

  • Letters
  • Digits
  • Special Characters
  • White Spaces
  • Alphabets: A ... Z
  • Numerals: 0 ... 9
  • Special Characters
     ,comma&ampersand
    .period ^caret
    ;semicolon *asteric
    :colon -minus sign
    ?question mark +plus sign
    'apostrophe <less than
    "quotation mark >greater than
    !exclamation (left parenthesis
    |vertical slash =equal to
    /slash )right parenthesis
    \back slash [left square bracket
    ~tilde ]right square bracket
    _underscore {left bracket
    $dollar sign }right bracket
    %percent sign #number sign
  • White Space:White Space is defined as spaces, carriage returns, linefeeds, tabs, vertical tabs, and form feeds. These are ignored by the compiler. But there are some exceptions: These are ignored by the compiler. But there are some exceptions:
    • The string constant cannot be split.
    • # include < header file > must be written on a single line.
    • // symbols are used in C++ to indicate comments. This is valid only till the end of that line. No white space should be used between the slashes.
  • Escape Sequences:Escape sequences are denoted by a backslash (\) and a character. E.g.: \t is an Escape sequence because the \ causes an ‘escape’ from the normal way the characters are interpreted. In the example given above, it is interpreted as the ‘tab’ character and not as character ’t’. Escape Sequences can be used in both character and string constants.
Table 2.1:Common Escape Sequences
Escape Sequence Character
\a Bell(Beep)
\b Back space
\f Formfeed
\n New Line
\r Return(Enter key)
\t Tab
\\ Backslash
\' Single Quotation Mark
\" Double Quotation Mark
\xadd Hexadecimal Representation


Next >> Keywords

Our aim is to provide information to the knowledge seekers. 


comments powered by Disqus








Footer1