在c++中如果我们要写一个空指针我们下意识会这么写
int *p = NULL;
但是在下面这段代码中就会出现问题
#include<iostream>
#include<cstdio>
#include<stddef.h>
using namespace std;
int f(int a)
{
cout<<"normal function"<<endl;
}
int f(int *a)
{
cout<<"ptr function"<<endl;
}
int main()
{
f(nullptr);
f(NULL);
return 0;
}
你们猜猜先后会输出什么语句