Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

练习6.50答案有误 #66

Open
coolhuhu opened this issue Sep 27, 2023 · 1 comment
Open

练习6.50答案有误 #66

coolhuhu opened this issue Sep 27, 2023 · 1 comment

Comments

@coolhuhu
Copy link

对于练习6.50中,f(42) 的最佳匹配为 f(int), 但可行函数应该包含两个吧,f(int)f(double, double=3.14)

如下程序所示

#include <iostream>
using namespace std;

void f(double x, double y=3.14) {
    cout << "double x, double y=3.14" << endl;
}

int main()
{
    f(42);
}

运行结果如图所示:
image

@LoseYSelf
Copy link

cout << "double "<< x <<", double y="<< y << endl;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants