Suppose I have two pointers in two different functions and I have a public variable, lets say:
Shape *sh1 = new Shape;
global_sh = sh1;
Shape *sh2 = new Shape;
global_sh = sh2;
What I want is something to store the address of the point sh1 or sh2 in global_sh. Now somewhere else I declare another pointer "sh3" and say sh3 = global_sh. Now if I say sh3.something() then it should return/call the related object. How can i do it?