赞
踩
代码示例:
#include <iostream> #include <cstring> using namespace std; void fun(char const *p) { cout << "fun(char const *p)" << endl; } void fun(int tmp) { cout << "fun(int tmp)" << endl; } int main() { fun(nullptr); // fun(char const *p) /* fun(NULL); // error: call of overloaded 'fun(NULL)' is ambiguous */ return 0; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。