More on Virtual Functions in C++

This tutorial will actually be a continuation of the topics covered in the last tutorial of Virtual Functions but this will be a fuller explanation of what virtual functions are and how they can be used in a program. We will present a simple database program with a virtual function to show how it can […]

Compounded Types in C++

Sometimes we need to handle limited set of values which can be referred by labels. For example the day of week, year names etc…

This concept in C/C++ is called enumeration. Here thisWeek is the variable of enum type week.
Enumerated Types
The enumerated type is used in C++ in exactly the same way it was used in […]

Pointers in C++

We can say the pointer as a variable which holds the memory address of another variable. If one variable contains the address of another variable, the first variable is said to point to the second.
Declaring a Pointer
If a variable is holding the address of another variable then we can declare it as

Here var_type is the […]

More on Encapsulation

The purpose of this tutorial is to illustrate how to use some of the traditional aspects of C or C++ with classes and objects. Pointers to an object as well as pointers within an object will be illustrated. Arrays embedded within an object, and an array of objects will be illustrated. Since objects are simply […]

Pointers

Each memory location that we use to store the data hase an address in computre memory (RAM). Computer Hardware i.e. CPU uses this addess to reference to a particular data item. A pointer is a variable that stores the address of another variable.

A pointer is a variable that represents the location of a data item, […]

C++ and Object Orientation

Object- Oriented Programming (OOP) is an approach to program organization and development that attempts to eliminate some of the pitfalls of conventional programming methods by in incorporating the best of structured programming features with several powerful new concepts. It is a new way of organising and developing programs and has nothing to do with any […]

Introduction to Classes in C++

The data types we have applied so far to our variables were used to identify individual items. To create more advanced and complete objects, C++ allows you to group these identifiers and create a newly defined object.

An object, such as a CD Player, a printer, a car, etc, is built from assembling various parts. In […]

Constructors in C++

A constructor is a special method that is created when the object is created or defined. This particular method holds the same name as that of the object and it initializes the instance of the object whenever that object is created. The constructor also usually holds the initializations of the different declared member variables of […]