• logo
  • PHP
  • PHP OOPs
  • script
    • JavaScript
    • JQuery
    • Ajax
    • AngularJs
    • VueJs
    • NodeJs
    • ReactJs
  • wordpress
  • Codeigniter
  • Codeigniter 4
  • Laravel
  • Python
  • MySql
  • Json
  • C
  • C++
  • More ...
    • Cakephp Framework
    • MongoDb
    • MySqli PDO
    • .htaccess
    • HTML 5
    • CSS
    • SEO
    • DCA

C++

  • What is C++
  • C++ Features
  • C++ program
  • C++ input/output
  • C++ Variable
  • C++ Data types
  • C++ Operator
  • OOPs
  • Access Specifier (Modifier)
  • Types of Member Functions
  • C++ Constructor
  • C++ Destructors
  • this pointer
  • Polymorphism

 Important Links

Read More

Home » C++ » 

Data Types in C++


They are used to define type of variables and contents used. Data types define the way you use storage in the programs you write.

There are 4 types of data types in C++ language.




Enum as Data type :-

Enumerated type declares a new type-name and a sequence of value containing identifiers which has values starting from 0 and incrementing by 1 every time.

enum day(mon, tues, wed, thurs, fri) d;
Here an enumeration of days is defined with variable d. mon will hold value 0, tue will have 1 and so on. We can also explicitly assign values, like, enum day(mon, tue=7, wed);. Here, mon will be 0, tue is assigned 7, so wed will have value 8.

Modifiers :-

Specifiers modify the meanings of the predefined built-in data types and expand them to a much larger set. There are four data type modifiers in C++, they are :
  • long
  • short
  • signed
  • unsigned


  • long and short modify the maximum and minimum values that a data type will hold.
  • A plain int must have a minimum size of short.
  • Size hierarchy : short int < int < long int
  • Size hierarchy for floating point numbers is : float < double < long double
  • long float is not a legal type and there are no short floating point numbers.
  • Signed types includes both positive and negative numbers and is the default type.
  • Unsigned, numbers are always without any sign, that is always positive.





  • Itechtuto

    Connect Us Socially:

    Quick Links

    • itech
    • About Us
    • Feedback
    • Trademarks
    • Privacy Policy
    • Terms of Use
    • Sitemap
    • Trademarks
    • Privacy Policy
    • Terms of Use
    • Sitemap

    Copyright © 2016 itechxpert (P) Ltd. All rights reserved.

    Copyright © 2016 itechxpert (P) Ltd. All rights reserved.