Constant in C++

Constant in C++

Constants are refer to fixed values that do not change during the execution of a program.


Constant in C++


{tocify} $title={Table of Contents}

Like C/C++ support several kinds of literal constant. They include integer,  characters, floating point number and strings. Literal constant do not have memory locations.

Example:-

123        //decimal integer

12.34     // floating point integer

0337     // octal integer

0X2      // hexadecimal integer

“C++”  // string constant

‘A’       // character constant

L’ab’    // wide-character constant

 

 

The wchar_t type is  a wide-character constant literal introduced by ANSI C++ and is intended for character sets that cannot fit a character into a single byte. Wide-character literal begin with litter L.

C++ also recognizes all the backslash character constants available in C 



Data science & data analyst

C++

Algorithms

Technology


Constant in C++

Post a Comment

Ask any query by comments

Previous Post Next Post