Data Types in C++ - Cyber Thieve

Data Types in C++

Data types define the type of data a variable can hold or can store. You can identify and differentiate a variable which type of it is called data type.

when a variables is declare it use data type during declaration to restrict the type of data to be stored.  So we can say that data types are used to tell the variables the type of data they can store. Whenever a variable is defined in C++, the compiler allocates some memory for that variable based on the data type with which it is declared. Every data type requires a different amount of memory.
C++ support many data types programmer can select any type of data type according to application.Data types specify the size and types of values to be stored. However, storage representation and machine instructions to manipulate each data type differ from machine to machine, although C++ instructions are identical on all machines.

Variable : 

variable is a container which can store a value.

Also Read :

Advantages of Object Oriented Programming
Object and Classes in C++
C++ Object Oriented Programming

also visit our  C++  tutorials


Data Types - C++
  • Primary or Built-in or Fundamental data type
  • Derived data types
  • User-defined data types

  1. Primitive or Built-in or Fundamental data Type :
These data types are built-in or predefined data types and can be used directly by the user to declare variables
  • Integer
  • Character
  • Boolean
  • Floating Point
  • Double Floating Point
  • Resource
  • Null

Datatype Modifiers :

Data Types modifiers are useClass

Structure

Union

Enumeration

d to change the length of the primitive data types to reduce the extra memory usage.

  • Signed
  • Unsigned
  • Short
  • Long
  
  1. Derived Data Types :
Derived data types is derived from primitive data types it can be four types .
  • Function
  • Array
  • Pointer
  • Reference

  1. User-Defined Data Types :
User defined data types are totally defined by user according to his own usage or intentions .
  • Class
  • Structure
  • Union
  • Enumeration

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Ok, Go it!