7,NULL与nullptr对比

 1 #include <iostream>
 2 #include <array>
 3 using namespace std;
 4 
 5 void show(int num)
 6 {
 7     cout << "int" << endl;
 8 }
 9 
10 void show(int *p)
11 {
12     cout << "int *" << endl;
13 }
14 
15 void main()
16 {
17     //NULL C风格的空指针会被误认整数
18     //nullptr C++风格的空指针 严格类型匹配
19 
20     show(NULL);
21     show(nullptr);
22     cin.get();
23 }
原文地址:https://www.cnblogs.com/xiaochi/p/8543704.html