Tuesday 12 February 2013

Data types in C++ Programming Language



C++ data types can be classified as

1) Basic data types
2) User defined data types
3) Derived data types

Basic data types in C++ Programming Language

These data types are already defined in the language. They are,

1) char
2) int
3) float
4) double

The following keywords are prefixed with the basic data types to produce new data types. These keywords are otherwise called as modifiers.

1) signed
2) unsigned
3) long
4) short

Special basic data type:
Void is a special basic data type. The compile will not allocate any memory space for this data type. This data type is used to

1) define functions.
2) define parameter passing

Example:

1. void fun1(); - This means the function fun1 will not return any value.

2. int fun2(); - This means the function fun2 will not receive any parameters. But returns an integer type value.

0 comments:

Post a Comment

Powered by Blogger.