hits counter
  Create Free Blog | Random Blog »   Report Abuse | Login   

 

Archive for January, 2009

“this” pointer:(special pointer)

*“this” is a special type pointer variable which contains the address of the current enable instance.
*That is it represents an object that invoke a member function.
*For example,the functin calls “S.read();” will set he pointer “this” to the address of the object S.
*This unique pointer is automatically passed to a function when it is called.
*The pointer [...]

Array of objects

*We can also have array of variables that are type class.Such variables are called array of objects.
*The syntax for declaring an array of objects is exactly same as other type of variable.
*Arrays of objects are accessed just like arrays of other types of variables.
*General format: className ObjectName[size];
*Example: Student S[2];
*The identifier Student is a user defined [...]

Object pointers

*In all the previous sections,you have been accessing members of an class by using the dot(.) operator.This is correct,when you are working with an object.
*We can also access a member of a class via a pointer object.When a pointer is used,the arrow operator(->) is used to call a member function.
*To declare a pointer object,specify its [...]

Copy Constructor

*One of the more important forms of an overloaded constructor is the copy constructor.
*A copy constructor take a reference to an object of the same class as itself as an argument.
*Once defined,the copy constructor is called whenever an object is to initialize another.
*The copy constructor only applies to initializations.It does not apply to assignments.
*The most [...]