gpt4 book ai didi

c++ - 我知道函数调用中存在歧义。有没有办法调用 foo() 函数?

转载 作者:行者123 更新时间:2023-11-27 22:36:57 24 4
gpt4 key购买 nike

<分区>

#include< iostream >

using namespace::std;

int foo(); //function with no argument
int foo(int=10); //Default argument

int foo()
{
cout<<"\n Foo , I am foo \n";
return 0;
}

int foo(int f)
{
cout<<"\n I am Foo too.\n";
return 0;
}

int main()
{
foo();
foo(2);
cin.get();
return 0;
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com