error C2027:use of undefined type 'A' see declaration of 'A
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/14 06:32:21
error C2027:use of undefined type 'A' see declaration of 'A
#include
using namespace std;
class A;
class B
{
public :
B(A * a){
a->c = 5;
}
};
class A
{
public:
int c;
void set()
{
B b(this);
cout
#include
using namespace std;
class A;
class B
{
public :
B(A * a){
a->c = 5;
}
};
class A
{
public:
int c;
void set()
{
B b(this);
cout
你在定义类B之前,只是声明了类A,这个声明是前向声明,在类A声明之后,定义之前,类A 是不完整类型,即已知A是一个类型,但不知道包含哪些成员.
对于不完整类型,只能定义一个A类型的指针或引用,且不能访问它的成员,因为编译器只知道有类A存在而不知道类A到底是什么.
再问: 不能访问,定义这个指针有什么意义呢?
再答: 定义这个指针,可以再定义A之后,访问
对于不完整类型,只能定义一个A类型的指针或引用,且不能访问它的成员,因为编译器只知道有类A存在而不知道类A到底是什么.
再问: 不能访问,定义这个指针有什么意义呢?
再答: 定义这个指针,可以再定义A之后,访问
error C2027:use of undefined type 'A' see declaration of 'A
报错c(179) :error C2275:'LNODE' :illegal use of this type as a
英语翻译The error of measurement of a zero-type MH in a NC machi
c# see declaration of 'book'
error C2275:'STU' :illegal use of this type as an expression
运行后说error C2275:'list' :illegal use of this type as an expre
see declaration of 'main'怎么翻译呢?
Undefined function or method 'y' for input arguments of type
Undefined function or method 'u' for input arguments of type
英语翻译Unlike merchandise trade that requires a declaration of
Trigger finger is a type of tendinitis.
a new type of汉语怎么说?