IDENTIFIERS C++ LANGUAGE


        IDENTIFIERS IN C++ LANGUAGE


C++ identifier is a name used to identify a variable, function, class, module, or any other user-defined item. An identifier starts with a letter A to Z or a to z or an underscore (_) followed by zero or more letters, underscores, and digits (0 to 9).

CONSTANTS


Constants refer to fixed values that the program may not alter and they are called literals.Or in simple words you can say constant is:-

  •    Any information  is constant
  •    Data=information=constant


Types of constant



types of constant,constant
TYPE OF CONSTANT




INTEGER CONSTANT

An integer literal can be a decimal, octal, or hexadecimal constant. A prefix specifies the base or radix: 0x or 0X for hexadecimal, 0 for octal, and nothing for decimal.

REAL CONSTANT(float)

A real constant(float) has an integer part, a decimal point, a fractional part, and an exponent part. You can represent real constant(float) either in decimal form or exponential form

CHARACTER CONSTANT


Character literals are enclosed in single quotes.



STRING CONSTANT



String constant are enclosed in double quotes. A string contains characters that are similar to character 


VARIABLE


variable in c,variable in c++
variables



KEYWORDS


Keywords in C++ Keyword is a predefined or reserved word in C++ library with a fixed meaning and used to perform an internal operation. C++ Language supports more than 64 keywords. Remember ,words which are in black colours presents in both  C and C++and  the words which are in red colour new introduce in C++.

keywords ,keywords in c++,keywords in c
keywords chart


DATA TYPE



§  Integer: Keyword used for integer data types is int. Integers typically requires 4 bytes of memory space and ranges from -2147483648 to 2147483647.

§  Character: Character data type is used for storing characters. Keyword used for character data type is char. Characters typically requires 1 byte of memory space and ranges from -128 to 127 or 0 to 255.

§  Floating Point: Floating Point data type is used for storing single precision floating point values or decimal values. Keyword used for floating point data type is float. Float variables typically requires 4 byte of memory space.

§  Double Floating Point: Double Floating Point data type is used for storing double precision floating point values or decimal values. Keyword used for double floating point data type is double. Double variables typically requires 8 byte of memory space.

§  void: Void means without any value. void datatype represents a valueless entity. Void data type is used for those function which does not returns a value.



data type ,data type in c++
data type

 DATA TYPE DECLARATION AND MEMORY LOCATION


data type , data type declaration in c++
data type declaration

Comments

Popular posts from this blog

Notepad, Wordpad and Paint

HOW TO PASS CCC EXAM WITH ONE ATTEMPT (NIELIT)

Inheritance in C++ Language(part 1)