cadre.cpp

来自「这个是继承与派生的实验」· C++ 代码 · 共 20 行

CPP
20
字号
//Cadre.cpp
#include<iostream.h>
#include<string.h>
#include"Cadre.h"
Cadre::Cadre():person()//初始化
{
	post=NULL;
}
void Cadre::putpost(const char*po)
{
	delete[]post;
	post=new char[strlen(po)+1];
	strcpy(post,po);
}
Cadre::~Cadre()
{delete[]post;}
void Cadre::print()
{
	cout<<"post="<<post<<endl;   //输出职务
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?