To exchange objects, a temporary reference is required.

Code:

C temp = ob1;       //make temp point to
                    //where ob1 points
ob1 = ob2;          //make ob1 point to
                    //where ob2 points
ob2 = temp;         //make ob2 point
                    //to where temp points
                    //(i.e. where ob1
                    // originally pointed)

 

To Next Slide To Previous Slide To Contents