C++ nullptr

#include<iostream>
using namespace std;

void get(int a)
{
    cout<<__func__<<"int"<<endl;
}
void get(int *a)
{
    cout<<__func__<<"int*"<<endl;
}

int main()
{
    int *p =NULL;//(void*)0;
    int *q = nullptr;//C++11的空指针定义
    get(NULL);
    get(nullptr);
//  get((void*)0);
}
posted @ 2016-03-30 10:27  夜色下的港湾  Views(153)  Comments(0Edit  收藏  举报