// abcTemplate.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include template class abc { T* m_pA; public: T getA() { return *m_pA; } abc( T A ) { m_pA = new T; *m_pA = A; } }; int main(int argc, char* argv[]) { printf("Hello World- Demonstrating Simple Templates!\n"); abc x(1); cout << "A = " << x.getA() << endl; abc y(0.123); cout << "A = " << y.getA() << endl; abc z( 'c' ); cout << "A = " << z.getA() << endl; return 0; }