Subscribe

Enter your email address:

Categories

 

February 2012
M T W T F S S
« Dec    
 12345
6789101112
13141516171819
20212223242526
272829  

Archives

Disclaimer

© 2009 Zero Intellect. All rights reserved. The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway. This material is not sponsored or endorsed by any of the vendors mentioned in this website and their Logos are trademarks of their own and their affiliates.

Types of Data Objects in C++

 

A data object is a block in computer memory that can either contain a single value of a group of values. The value of the data objects can be accessed using a simple variable or another complex expression. Each object has a unique data type which determines how much storage would be allocated in memory. It is also used in any type checking operations. Both the identifier and data type of an object are established in the object declaration.

Suppose we declare an instance S1 of a class named Student that has variables name, age, class and other similar variables

Instance (S1 above) is known as the “class object”

Members of the class (age, name, etc) are also called “member objects”

The collection of all member objects within a class is what constitutes a class object

 

There are three major classes of data types

Fundamental types vs derived types
Built-in types vs user-defined types
Scalar types vs aggregate types

 

Fundamental data types are the ones that are “built-in” to the language. These already exist and are not created by the user. Examples are integers, floating-point numbers and characters. Derived data types are created from the set of basic types and include arrays, pointers, structures, classes, unions, and enumerations
Built-in data types as made out by their name are those data types that are present and include all of the fundamental types and also include data types that refer to the addresses of basic types, such as arrays and pointers. User-defined types are created by the user from the set of basic types, in typedef, structure, classes, union, and enumeration definitions

Scalar types represent a single data value (like an integer) whereas aggregate types represent multiple values, of the same type or of different types. Scalars data types include the arithmetic types and pointers. Aggregate types include arrays, classes and structures

2 comments to Types of Data Objects in C++