为什么会报错显示Match不是类或命名空间名称
class Time
{
friend void Match::printTime(Time &t);
public:
Time(int hour, int min, int sec)
{
m_iHour = hour;
m_iMinute = min;
m_iSecond = sec;
}
private:
int m_iHour;
int m_iMinute;
int m_iSecond;
};
class Match
{
public:
void printTime(Time &t)
{
cout << t.m_iHour << "-" << t.m_iMinute << "-" << t.m_iSecond << endl;
}
};
int main()
{
Time t(6, 36, 25);
Match m;
m.printTime(t);
system("pause");
return 0;
}