【发布时间】:2011-04-29 00:06:06
【问题描述】:
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
class Student;
void function_A(Student& s)
class Student {
void function_B() {
::function_A(*this);
}
int courses;
};
void function_A(Student& s)
{ // line 18 (where error is occurring)
s.courses = 1;
}
int main()
{
Student s;
s.function_B();
return 0;
}
我得到的错误如下:
(第 18 行)新类型可能未在返回类型中定义。
【问题讨论】:
-
+1。这比看起来更棘手。我编辑了标题以使其更具描述性。
-
欢迎来到 StackOverflow!很好的问题,但请不要在人们仍在回答您的问题时更改您的代码。
标签: c++