05-02-2011, 05:48 PM
You know very well that an object has some characteristics as well as exhibit behavior. State of an object infect is the current value of its data members (characteristics).
In case of deep copy constructors.......
when an object initialize with an existing object's state, then a memory space is allocated to the newly created object. In order to understand this concept easily, please have a look to the statements given below.
Shallow copy means like a "pass by value" e.g. a = b;
deep copy means like a "pass by reference" e.g. a = &b;
so, as you see in deep copy address is passing. In such a situation, problem is same memory location is pointed by different pointers due to address passing.
"this" pointer can't access the static data members because these are class members rather than object. "this" pointer is related with object rather than class, that's why, unable to access static data members.
In case of deep copy constructors.......
when an object initialize with an existing object's state, then a memory space is allocated to the newly created object. In order to understand this concept easily, please have a look to the statements given below.
Shallow copy means like a "pass by value" e.g. a = b;
deep copy means like a "pass by reference" e.g. a = &b;
so, as you see in deep copy address is passing. In such a situation, problem is same memory location is pointed by different pointers due to address passing.
"this" pointer can't access the static data members because these are class members rather than object. "this" pointer is related with object rather than class, that's why, unable to access static data members.
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
