来自「visualCplusplus学习课件大连东软培训教材」· 代码 · 共 46 行

TXT
46
字号
// Test01.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream.h>

class CA
{
public:
	CA(int x, int y)
	{
		m_nX = x;
		m_nY = y;
	}
protected:
	int m_nX;
	int m_nY;
};


class CB : public CA
{
public:
	CB(int x, int , int z);
	void Display();
protected:
private:
	int m_nZ;
};

CB::CB(int x, int y, int z)
:CA(x, y)
{
	m_nZ = z;
}

void CB::Display()
{
	cout << m_nX << "  " << m_nY << "   " << m_nZ <<endl;
}

void main()
{
	CB b(1, 2, 4);
	b.Display();
};

⌨️ 快捷键说明

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