每当我运行我的头文件时,程序都会抛出一个错误,上面写着:错误:期望')'之前',' token(指我的类构造函数)。但是,当我删除第一个变量时,它会抛出先前第二个变量的错误。请帮忙。
#ifndef STACKARRAYSECURITY_h
#define STACKARRAYSECURITY_h
#include <string>
#include <cstdlib>
#include <iostream>
template <class stacktype>
class stackarray {
private:
std::string password = "NULL";
unsigned long int maxsize, stacktop;
stacktype * stackarrayptr;
bool setpassword(std::string newpassword);
bool allowdynamic = false;
public:
bool accessdynamics(std::string iptpassword);
stackarray(password, maxsize = 0) {
stackarrayptr = new stacktype[maxsize];
}
};
#endif