?? mainprogram.cpp
字號:
//Chapter 13: Virtual Functions and value parameters
#include <iostream>
#include "derivedClass.h"
using namespace std;
void callPrint(baseClass p);
int main()
{
baseClass one(5); //Line 1
derivedClass two(3, 15); //Line 2
one.print(); //Line 3
two.print(); //Line 4
cout << "*** Calling the function "
<< "callPrint ***" << endl; //Line 5
callPrint(one); //Line 6
return 0;
}
void callPrint(baseClass p) //p is a value parameter
{
p.print();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -