错误信息 [英] Error message

查看:104
本文介绍了错误信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在使用重载方法进行集合程序。

但我有一些错误,因为据说方法isValid是

未声明。

他是我课程的一部分。


#include< iostream>

#include< string>

#include< iomanip>


使用命名空间std;


class IntegerSet

{

私人:

bool set [26];

int element;


public:

//方法

IntegerSet(); // default

构造函数

IntegerSet(int x [],int k); //重载

构造函数


bool isValue(int);

void insertElement(int);

void deleteElement(int);

void setString();

void inputSet();

};


//方法isValid

bool IntegerSet :: isValid(int i)

{

return set [i];

}


谢谢。

Hi I am doing a program of sets using overloaded methods.
But I am having some error because supposedly the method isValid is
undeclared.
He is some part of my program.

#include <iostream>
#include <string>
#include <iomanip>

using namespace std;

class IntegerSet
{
private:
bool set[26];
int element;

public:
//Methods
IntegerSet(); //default
Constructor
IntegerSet(int x[], int k); //overload
constructor

bool isValue(int);
void insertElement(int);
void deleteElement(int);
void setString();
void inputSet();
};

//methos isValid
bool IntegerSet::isValid(int i)
{
return set[i];
}

Thanks.

推荐答案

11月10,6:07 pm,Latina< sdl ... @ gmail.comwrote:
On Nov 10, 6:07 pm, Latina <sdl...@gmail.comwrote:

您好我正在使用重载方法进行集合程序。

但我有一些错误,因为据说方法isValid是

未声明。

他是我程序的一部分。

#include< iostream>

#include< string>

#include< iomanip>


使用命名空间std;


class IntegerSet

{

private:

bool set [26 ];

int element;


public:

//方法

IntegerSet(); //默认构造函数

IntegerSet(int x [],int k); //重载构造函数


bool isValue(int);

void insertElement(int);

void deleteElement(int);

void setString();

void inputSet();


};
Hi I am doing a program of sets using overloaded methods.
But I am having some error because supposedly the method isValid is
undeclared.
He is some part of my program.

#include <iostream>
#include <string>
#include <iomanip>

using namespace std;

class IntegerSet
{
private:
bool set[26];
int element;

public:
//Methods
IntegerSet(); //default constructor
IntegerSet(int x[], int k); //overload constructor

bool isValue(int);
void insertElement(int);
void deleteElement(int);
void setString();
void inputSet();

};



这是指向箭头所在的错误消息:

no`bool IntegerSet :: isValid(int)''成员函数声明在课堂上

`IntegerSet''

This is the error message pointing where the arrow is:
no `bool IntegerSet::isValid(int)'' member function declared in class
`IntegerSet''


//方法isValid

bool IntegerSet :: isValid(int i )
//methos isValid
bool IntegerSet::isValid(int i)



- {

--{


return set [i];

}


谢谢。
return set[i];
}

Thanks.



class IntegerSet
class IntegerSet

{
{



< snip>

<snip>


bool isValue(int);
bool isValue(int);



< snip>

<snip>


};


//方法isValid

bool IntegerSet :: isValid(int i )

{

返回集[i];


}
};

//methos isValid
bool IntegerSet::isValid(int i)
{
return set[i];

}



isValue与isValid不同。其中一个拼写错误。

或两者兼而有。


Michael

isValue is not the same as isValid. One or the other is misspelled.
Or maybe both.

Michael


isValue与isValid不同。其中一个拼写错误。
isValue is not the same as isValid. One or the other is misspelled.

或者两者兼而有。


Michael
Or maybe both.

Michael



oops我没注意到,谢谢

但我还有其他一些错误。


错误:`isValid''未声明(首先使用此功能)


(箭头指向的地方)

IntegerSet运算符+(IntegerSet& right)

{

IntegerSet j;


for(int element = 0; element< = 25; element ++)

{

- if(isValid (元素)|| right.isValid(元素))

j.insertElement(element);

}

返回j;

}

oops I didnt notice that, thanks
but I still have some other errors.

error: `isValid'' undeclared (first use this function)

(where the arrow is pointing)
IntegerSet operator+(IntegerSet &right)
{
IntegerSet j;

for(int element=0; element<=25; element++)
{
-- if(isValid(element) || right.isValid(element))
j.insertElement(element);
}
return j;
}


这篇关于错误信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆