我自定义了一个twoTuple类,在main函数里想要定义一个twoTuple类型的函数,但是报错显示缺少;
class twoTuple
{
public:
twoTuple(string type, string value);
~twoTuple();
string type; //类型
string value; //值
void setType(string type) { this->type = type; }
string getType() { return type; }
void setValue(string value) { this->value = value; }
string getValue() { return value; }
//返回二元式字符串
string show() {
return "(" + type + "," + value + ")";
}
private:
};
twoTuple::twoTuple(string type, string value)
{
this->type = type;
this->value = value;
}
twoTuple::~twoTuple()
{
}
int main()
{
twoTuple getNext(){
}
return 0;
}