Witam. Program jak poniżej, błędy to:
Error 1 error LNK2019: unresolved external symbol "public: __thiscall Stos<int,10>::~Stos<int,10>(void)" (??1?$Stos@H$09@@QAE@XZ) referenced in function _main c:\Users\Admin\documents\visual studio 2010\Projects\szablonstos\szablonstos\sztos.obj
Error 2 error LNK1120: 1 unresolved externals c:\users\admin\documents\visual studio 2010\Projects\szablonstos\Debug\szablonstos.exe
#include <iostream>
#include <istream>
using namespace std;
template<class T,int R>
class Stos
{
public:
T *tab;
int ostatni;
Stos(int x=0)
{
ostatni=x;
tab=new T[R];
}
void push()
{
if(ostatni>R)
{
cout<<"Stos jest pelny!";
}
else
{
ostatni++;
cout<<"Jaki element chcesz dodac?: ";
cin>>tab[ostatni];
}
}
void pop()
{
if(ostatni=0)
{
cout<<"Stos jest pusty!";
}
else
{
tab[ostatni]=0;
ostatni--;
}
}
void top()
{
cout<<"Ostatni element na stosie to: "<<tab[ostatni];
}
void isempty()
{
if(ostatni==0) cout<<"Stos jest pusty!";
else cout<<"Stos nie jest pusty!";
}
~Stos();
};
int main()
{
Stos<int,10> stosik1;
stosik1.push();
stosik1.pop();
stosik1.top();
stosik1.isempty();
system("pause");
return 0;
}