11.2 函数的占位参数

    技术2022-07-11  87

    11.2 函数的占位参数

    函数可以有一个占位参数,这个形参没有具体的名字,但可以有默认值。以目前我们学到的技术,还没办法使用这个占位参数。

    #include<iostream> using namespace std; //目前占位参数用不到 //可以有默认值 int = 10 void func(int a, int) { cout << "this is func" << endl; } int main() { func(10, 1); }

    Processed: 0.024, SQL: 9