为什么指针指向类的函数,系统就run不出来了
#include<iostream>using namespace std;
class cl_1
{
private:
int a_1,a_2;
public:
inline void h_1(int,int);
inline int h_2(void);
inline int h_3(void);
}op_1,op_2,* op_5,& op_7=op_1;
inline void cl_1::h_1(int b_1,int b_2)
{
a_1=b_1;
a_2=b_2;
}
inline int cl_1::h_2(void)
{
return a_1;
}
void get_1(void){};
inline int cl_1::h_3(void)
{
return a_2;
}
int main(void)
{
cl_1 op_3,op_4,* op_6,& op_8=op_2;
op_1.h_1(1,2);
cout<<op_1.h_2()<<op_1.h_3()<<"\t1"<<endl;
op_7.h_1(1,2);
cout<<op_7.h_2()<<op_7.h_3()<<"\t2"<<endl;
op_2.h_1(1,2);
cout<<op_2.h_2()<<op_2.h_3()<<"\t3"<<endl;
op_3.h_1(1,2);
cout<<op_3.h_2()<<op_3.h_3()<<"\t4"<<endl;
op_4.h_1(1,2);
cout<<op_4.h_2()<<op_4.h_3()<<"\t5"<<endl;
op_5->h_1(2,3);
cout<<op_5->h_2()<<op_5->h_3()<<"\t6"<<endl;//??
op_8.h_1(2,3);
cout<<op_8.h_2()<<op_8.h_3()<<"\t7"<<endl;
op_6->h_1(2,3);
cout<<op_6->h_2()<<op_6->h_3()<<"\t8"<<endl;//??
return 0;
}