我正在为堆栈结构创建我的赋值并检查表达式的正确性并编译错误 我已经阅读了其他问题,但无法找到解决方案。我已经编写了所有构造函数和析构函数
E:\Smester 4\Data Structure and Algoritham\Assignments\Assignment7\CheckBalance.o CheckBalance.cpp:(.text+0x2b): undefined reference to `stack<char>::stack()'
E:\Smester 4\Data Structure and Algoritham\Assignments\Assignment7\CheckBalance.o CheckBalance.cpp:(.text+0xe8): undefined reference to `stack<char>::push(char)'
E:\Smester 4\Data Structure and Algoritham\Assignments\Assignment7\CheckBalance.o CheckBalance.cpp:(.text+0x106): undefined reference to `stack<char>::pop()'
我的程序文件是(构造函数)
在stack.h中
public:
stack();
private:
int counter;
node<T>* last;
在stack.cpp中
template<class T>
stack<T>::stack(){
last = 0;
counter = 0;
}
CheckBalance.h中的
public:
CheckBalance();
private:
stack<char>* mystack ;
CheckBalance.cpp中的
CheckBalance::CheckBalance()
{
mystack= new stack<char>();
}