代码如下:
#include <iostream>
using namespace std;void func(char *p)
{cout << "void func(char *p)" << endl;
}void func(int p)
{cout << "void func(int p)" << endl;
}int main()
{func(10);func(NULL);return 0;
}
测试结果:
#include <iostream>
using namespace std;void func(char *p)
{cout << "void func(char *p)" << endl;
}void func(int p)
{cout << "void func(int p)" << endl;
}int main()
{func(10);func(nullptr);return 0;}
测试结果: