///////////////////////////////////////////////////////////////////// // MT2Q6 #include template void fun1(T*& refPtrT) { refPtrT = new T; } template void fun2(T** ppT) { *ppT = new T; } class hello { public: void say() { std::cout << "\n hello"; } }; class hi { public: void say() { std::cout << "\n hi"; } }; void main() { hello* phello; fun1(phello); phello->say(); delete phello; hi* phi; fun2(&phi); phi->say(); delete phi; std::cout << "\n\n"; } hello hi