简体   繁体   中英

Optional argument passing in c++

需要格式化,编辑需要一些时间。

I cannot tell what you're asking but I'm going to attempt to interpret it as what I read..

void function_one(int a, int b = 3);
void function_two(int a);

void function_one(int a, int b)
{
    function_two(b); //pass second argument to function two..
}

void function_two(int a)
{
    function_one(5);
}

Note that the above is infinite recursion due not having a base case condition.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM