tag:blogger.com,1999:blog-3923972986350080010.post2795710613289703311..comments2024-02-24T01:10:51.402+05:30Comments on Milinda Pro: Cteate Stack in C++ using templateMilinda Arunahttp://www.blogger.com/profile/01814826073141684396noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-3923972986350080010.post-72736222555866573612013-08-06T15:26:04.077+05:302013-08-06T15:26:04.077+05:30Hi Milinda Aruna,
Thanks for your post. I'm a ...Hi Milinda Aruna,<br />Thanks for your post. I'm a novice in C/C++. I had try your code with VS2010. It run OK. But I saw at line:<br /><br />stackData = new T[size];//to hold the T type data items<br /><br />You had new a pointer object but I don't see you do any thing in the destroy function. I had tried to to put addtion code like this.<br /><br />virtual ~Stack(){<br /> if(stackData){<br /> delete stackData;<br /> cout<<"~Stack: Destroyed"<<endl;<br /> }<br /> };<br /><br />I run again, and get error. Could you explain what is issue when I do like this. Many thanks!zizopenhttps://www.blogger.com/profile/00436043176524521246noreply@blogger.com