我是靠谱客的博主 热情小鸭子,这篇文章主要介绍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);
}

最后

以上就是热情小鸭子最近收集整理的关于C++ nullptr的全部内容,更多相关C++内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(141)

评论列表共有 0 条评论

立即
投稿
返回
顶部