Explain different data types available in C++ programming.

C++ supports a large number of data types. Thus built in or basic data types supported by c++ are integer,
floating point and character type. A brief discussion on these three data types.
A. Integer data types (int): it accepts numeric data such as numbers.
  • Short
  • Long
  • Unsigned
B. Floating point data type (float) :- A floating point number has a decimal point. Even if has an integral value, it must include a decimal point at the end. These numbers are used formeasuring quantities. Examples of valid floating point numbers are : 43.5, -54.9, and 45.087.

C. Void data type :-

It is used for following purposes:
  • It specifics the return type of a function when the function is not returning any value.
D. Char data type : It accepts one character or small integer.
1 byte Signed:-128 to 127
Unsigned: 0 to 255
2. Derived data types:-
c++ also four types of derived data types. As the name suggests, derived data
types are basically derived from the built-in data types. There are four derived data types. these are:-
  • Array
  • Function
  • pointer
  • Reference
3. User Defined data types:-
c++ also permits four types of user defined data types. As the name suggests, user defined data types are defined by the programmers during the coding of software development. There are four user defined data types. These are:-
  • Structure
  • Union
  • Class
  • Enumerator

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.