帮小弟看一下,到底是那里出了问题?
我试了好久都有问题,编译不能通过,说无法访问point类中的a和c。望各位帮指正、#include<iostream>
using namespace std;
class sh;
class point
{
private:
int a;
public:
int b;
point(int pa,int pc)
{
a=pa;
c=pc;
}
friend void sh::showp(point &);
protected:
int c;
};
class sh
{
private:
int s;
public:
void showp(point &);
};
void sh::showp(point &bo)
{
cout<<bo.a<<"\t"<<bo.c<<endl;
}
int main()
{
point bo(29,89);
bo.showp(bo);
return 0;
}