The following is my code,
#include #include using namespace std; class TestClass { public: virtual void test(string st1
You need to change the parameter for a reference (or a pointer)
void pass(TestClass &t)
This way, the original object will be used.