请教一道C++题目
#include <iostream>using namespace std;
class Time
{
public:
Time(int,int,int);
int hour;
int minute;
int sec;
void get_time(int);
void output_minute();
};
Time::Time(int h,int m,int s)
{hour=h;minute=m;sec=s;}
void Time::get_time(int a)
{cout<<a<<","<<hour<<","<<minute<<","<<sec<<endl;}
void Time::output_minute()
{cout<<minute<<endl;}
void main()
{
Time t1(10,13,56);
int *p1=&t1.hour;
cout<<*p1<<endl;
t1.get_time(2008);
Time *p2=&t1;
p2->get_time(2008);
void (Time::*p3)();
p3=&Time::get_time(2008);(t1.*p3)();
p3=&Time::output_minute;(t1.*p3)();
}
编译时出现如下错误,不明白,望高手指点
error C2352: 'Time::get_time' : illegal call of non-static member function