tokens in c++

Tokens in C++-:  The token is the smallest individual units in a  program. In other words we can say that the smallest unit in the program called tokens. In the C++ programming language  token has the following types

  1. Keywords
  2. Identifiers
  3. Constant
  4. String 
  5. Operator 

Keywords in C++ -: The keywords implemented specific C++ language features. They are explicitly reserved identifiers and can not be used as names for the program variable or other user define program elements.

In other words we can say that the Keywords are pre-defined or reserved words in the programming language. Every  keyword has a  meant to perform a specific function in a program. Since keywords are referred names for a compiler, they can not  used as variable names. here are list has been given for ..

c++ keywords

 

Identifiers  in c++- : It refer to the names of variable,function, array, classed etc. created by the programmer. They are fundamental requirement of any language.Each language has its own rules for naming these identifiers. These are the following rules in c language and c++ language..

  • Only alphabetic characters, digits and underscores are permitted.
  • The name can not started with a digit.
  • First letter must be an alphabet or underscore (_).
  • Uppercase and lowercase letters are  distinct.
  • Reserved keywords can not be used as an identifier’s name.

Major difference between c and c++ language is the limit on the length of a name. While ANSI C recognize only the first 32 character in a name And ANSI C++ place no limit on its length and therefore all the character in a name are significant.

Constant in c++-:  Constant refer the fix values that do not change during the execution of a program. Like c language C++ support several kinds of literal constant . C++ include integer, character, floating point number and string.  literal constant do not have memory allocation as like

1  2 3                         // decimal intger

1 2 .6 5                     // floating point decimal

 

Operator in C++ -:  C++ support a rich set of built in operator we have already used several of them such as equal to add(+)Minus(-)  multiplication(*) and division(/) operator is a symbol that tells the computer to perform certain mathematics or logical manipulation. operators are used in program to manipulate data and variables. they usually form a part of mathematical or logical expression.

All the c programming language operator are valid in c++ language. C ++ support some extra these are the

: :             Scope Resolution Operator

:  : *          pointer to member declarator

->*            Point to member operator

.*               Point to member operator

Delete     memory release operator

End1       line feed operator

New         Memory allocation operator

Setw         Field with operator

 

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *