01-04-2012, 10:17 PM
Suppose you have two member functions of a Class: set() and get()
set(int object)
{
this->object = object;
}
int get()
{
int object = this->object;
return object;
}
In the set function, we are storing the value passed to the set function in the member variable of the class. If this is confusing you, you can write it as:
set (int obj)
{
object = obj;
}
Similarly, in the get function, class variable is stored into a local variable.
set(int object)
{
this->object = object;
}
int get()
{
int object = this->object;
return object;
}
In the set function, we are storing the value passed to the set function in the member variable of the class. If this is confusing you, you can write it as:
set (int obj)
{
object = obj;
}
Similarly, in the get function, class variable is stored into a local variable.
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
