广东本月二十五日天气:高手来帮忙改一下C++程序的错误

来源:百度文库 编辑:高考问答 时间:2024/04/18 14:59:01
1
#include <iostream.h>
class A{
public: void fun( ){cout<<"A.fun"<<endl;}
};
class B{
public: void fun( ){cout<<"B.fun"<<endl;}
void gun( ){cout<<"B.gun"<<endl;}
};
class C:public A,public B{
private:int b;
public:void gun( ){cout<<"C.gun"<<endl;}
void hun( ){fun( );}
};
2
class one{
private:
int a;
public:
void func(two&);
};
class two{
private:
int b;
friend void one::func(two&);
};

c++帮助文件很全面,自己找,养成自己动手习惯才是合格程序员

出错的结果是什么,你不说,也不想看,