Basic concepts of C++ | Character in C++ | Identifier in C++

Basic concepts of C++

Basic concepts of C++



Character Set of C++

These are the characters which we can use in C++ . Character set includes following characters

  • Alphabets ( a-z, A-Z )
  • Digits (0-9)
  • Special Characters ( #,+,-,*, \ , / etc.)
  • White Spaces (Blank Space, Backspace, tab etc.)

Token in C++

Smallest identifiable parts of a Program is known as token.

There are six types of tokens

  • Keywords
  • Identifiers
  • Variables
  • Constants
  • Operators
  • Punctuators

Keyword in C++

Keywords are reserved and predefined words of  C++. They have predefined meanings and functioning. 48 standard keywords are provided by C++. They are as follows:

auto                  asm                  break               case                 catch                char

const                continue           class                 default             delete               do

double             else                  enum               extern              float                 for

friend               goto                 if                      inline               int                    long

new                  operator           private             protected          public              register

return               short                signed              sizeof               static                struct

switch              template           this                   throw               try                    typedef

union               unsigned          virtual              void                 volatile             while

Keywords can’t be used as identifiers, variables or named constants. With advancements in C++, various new keywords are being added.

Identifier in C++

Different quantities such variable, constant, functions can be called identifiers.

Rules for naming an identifier are as follows

  • Alphabets as well as digits can be used.
  • First character can be alphabet or underscore.
  • Digits can appear only after first character.
  • No special characters except underscore can be used.
  • Keyword can’t become identifiers.
  • Space can’t appear.



Spread the love
Lesson tags: Character Set of C++, Identifier in C++, Keyword in C++, Token in C++
Back to: C++ Programming Notes
Spread the love