函数高级 — 函数的占位参数

点击查看代码
#include<iostream>
#include<string> 

using namespace std;

//占位参数
//返回值类型 函数名(数据类型){}

//目前阶段的占位参数我们还用不到,后面课程中会用到
void func(int a, int){

	cout << "func" << endl;
}
//占位参数 还可以有默认参数
void func01(int a, int = 5){

	cout << "func01" << endl;
}

int main(){

	func(10, 5);

	system("pause");

	return 0;
}

 

posted @ 2021-08-11 08:58  毋纵年华  阅读(33)  评论(0)    收藏  举报