C++ is one of the most versatile languages in the world. It is used nearly everywhere for everything… systems programming (operating systems, device drivers, database engines, embedded, Internet of Things, etc.)

Enter Header Image Headline Here

Saturday 15 April 2017

C++ Contants/Literals

                                  C++ Contants/Literals 

Constants refer to fixed values that the program may not alter and they are called literals.

Constants can be of any of the basic data types and can be divided in integer Numerals, Floating-point Numerals, Characters, Strings and Boolean values.

Again, Constants are treated just like regular variables except that their values cannot be modified after their definition.

C+++ Modifier Types :


C++ allows the char, int, and double data types to have modifiers preceding them. a modifier is used to alter the meaning of the base type so that it more precisely fits the needs of various situations.

The data type modifiers are listed here :

  • signed
  • unsigned 
  • long
  • short

The modifiers signed, unsigned, long, and short can be applied to integer base types. In addition, signed and unsigned, can be applied to char, and long can be applied to double.

The modifiers sigened and unsigned can also be used as prefix  to long or short modifiers. For example unsigned long int.

C++ allows a shorthand notation for declaring unsigned, short, or long integers. You can simply use the word unsigned, short, or long, without the int. the int is implied. For ex., the following two statements both declare unsigned integer variables.

unsigned x;
unsigned int y;


0 comments:

Post a Comment

Popular Posts

Recent Posts

Categories

Unordered List

Text Widget