⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch11cgolfer.cpp

📁 此例子是学习C++的好东西
💻 CPP
字号:
//Program 11-8 CGolfer   CGolfer is derived from CPerson

// File:  Ch11CGolfer.cpp

#include "Ch11CGolfer.h"
#include <iostream>
#include "Ch11CPerson.h"
using namespace std;

/*

CGolfer::CGolfer(string n, int a, int h) //Route 1 this inits all
{
	name = n;
	age = a;
	cout << "\nIn the CGolfer constructor \n";
	handicap = h;

}*/

CGolfer::CGolfer(string n, int a, int h) : CPerson(n, a) // Route 2 calls CPerson
{
	cout << "\nIn the CGolfer constructor \n";
	handicap = h;
}


void CGolfer::WriteGolfer()
{
	CPerson::WritePerson();
	cout << "\n Handicap:  " << handicap;
}

⌨️ 快捷键说明

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