Dynamic Allocation in Template Class Constructor
I am working on a stack class and have two constructors. One of interest is this one. template <typename T> stack<T>::stack( const int n) { capacity = n ; size = 0 ; arr = new T [capacity] ; } I am calling it inside main like this. stack<int> s1(3) ; The program compiles fine but i get this run time error. 1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall stack<int>::~stack<int>(void)" (??1?$stack@H@@QAE@XZ) referenced in function _main 1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall stack<int>::stack<int>(int)" (??0?$stack@H@@QAE@H@Z)