求助:哪位c++高手帮帮忙!

来源:百度知道 编辑:UC知道 时间:2024/04/29 23:15:23
要编一个程序,必须包括以下内容:
1.派生 2.重载 3.多文件结构 4.string类 5.友元 6.数组 7.指针 8.静态成员。
谢谢啦!!!!
我前面写错了,没有数组和指针,就是string类指针,还有就是函数模板和访问控制

#include<string>//好多文件阿
#include<math.h>
#include<iostream>

using namespace std;

void myfriend(){}

class A
{
};
class B:public A//派生
{
public:
static string *m_string[2];//静态成员string类指针数组
A(){}
A(int a){}//重载构造函数
friend void myfriend();//友元函数
};
B::m_string[0]=NULL;
B::m_string[1]=NULL;
void main()
{

B b;
cout<<"无语。。。。"<<endl;
}

这还不简单了
你把书上的全部终合不就行

看书去~~~~