Data types: -

C++ data types can be classified as

1. Standard data types

2. Derived (extended data types)

3. User defined data types

Standard data types:

Standard data types are used to tell the compiler what type of data to be handled by an identifier. These data types give complete details of the behavior of a data type. It is used to handle only one value at a time by using single identifier.

Derived data types (extended data types):

Derived data types are used to extend the behavior of an existing simple data type to get more functionality. It is used to handle more than one value at a time using a single identifier. For example arrays

User defined data types:

User defined data types are created by a user by using simple, derived, user defined data types as per the user requirement. The user has to decide the functionality and behavior of these data types. By using these data types to handle more than one data type using single identifier For example structures and classes

Classification of Data types

Void: - The Void is used to represent the following things

1) To specify the return type of a function when it is not returning any value.

2) To indicate an empty argument list to a function

Qualifier: qualifiers are used to extend the behavior of standard data type. There are two qualifiers namely size and sign. Size qualifier is used to extend the size of an existing data type and sign qualifier used to make the data type as a signed number or unsigned numbers.

Size qualifier: there are two size qualifiers they are short and long. Short is used to decrees the size and ling is used to extend the size to maximum. For example short int size is only 2 bytes irrespective of operating system. It is not possible to apply size qualifier on char

Sign qualifier: there are two sign qualifiers they are signed and unsigned. Unsigned qualifier is used to make the number as a positive number. By default all number are positive. It is not possible to apply sign qualifier on long, double.

Advertisement

Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.