[求助]函数构造问题
#include "StdAfx.h"#include <iostream>
using namespace std;
class Student
{
public:
Student()
{
cout<<"constructing student. \n";
semeshours=100;
gpa=3.5;
}
protected:
int semeshours;
float gpa;
};
class Teacher
{
public:
Teacher()
{
cout<<"constructhing teacher. \n";
}
};
class tutorpair
{
public:
tutorpair()
{
cout<<"constructing tutorpair. \n";
nomeetings=0;
}
protected:
Student student;
Teacher teacher:
int nomeetings;
};
void main()
{
tutorpair tp;
cout<<"back in main. \n";
}
请问nomeetings怎么错了?