C++ Data Types & Sizes Tutorial by BCA Study

Ashutosh Kumar
By -
0
C++ Data types and its sizes



Hello, IGNOU BCA Reader,

As we have been read C programming in second semester of MCS012 book C Programming and Problem solving. In that chapter we have been read also DATA TYPE ( types of data ). Where we have been introduce 4 type of primitive data that are char, int, float, double.

But in C++ Programming language having support of large no. of data types.

C++ Programming has built-in data types.

  • int 
  • float
  • double
  • void
  • char
  • wchar_t     (wide character     2-4 bytes / 1 wide character)

 
 
Name Description Size Range
char character or small integer
1byte -127 to +128
short int short integer 2bytes 0 to 65535 or -32768 to 32767
int Integer 4bytes -2147483648 to 2147483647
long int(long) Long integer 8bytes -9223372036854775808 to 9223372036854775807
bool
Boolean value.(true or false) 1bit true or false
float Floating point number 4bytes +/- 3.4e+/-38 (~7 digits)
Double double precision floating point number 8bytes +/- 1.7e+/-308(~15digits)
wchar_t Wide character 2 or 4 bytes 1 wide character


Derived Data types


C++ also permits four types of derived data types. As the name suggests, derived data types are basically derived from build-in data types.These are the data types.

  • Array
  • function
  • Pointer
  • Reference

User Defined Data Types


C++ also permits four types defined data types. According to name, user defined data types are defined by programmer during coding of software development. These are four of four types. Name them.

  • Structure (struct)
  • Union
  • Class
  • Enumerator  

 

Next >>

Post a Comment

0Comments

✍️ Only article/post centric comments are allowed.
❌**No Spam**
❌**Advertisement**
❌**No abuse**
Rules strictly applied ✅

Post a Comment (0)