hai
i have class A and Class B along with two objects
A a1;
B b1;
(void *)
so i want to swap two objects using void pointer
Can anyone help me...do the needful asap
hai
i have class A and Class B along with two objects
A a1;
B b1;
(void *)
so i want to swap two objects using void pointer
Can anyone help me...do the needful asap
What do you mean with swap? swap what?
What is the situation you want to arrive at?
Cheers,
_
You mean you want to do something like this?
Qt Code:
A * a = new A(); B * b = new B(); A * c = (A *)( void * )b;To copy to clipboard, switch view to plain text mode
You might be able to fool the compiler into accepting code like that, but what do you think will happen when you try to execute a member function of class A when the variable c actually points to an instance of class B?
Bookmarks