-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnullptr.cpp
More file actions
31 lines (23 loc) · 723 Bytes
/
nullptr.cpp
File metadata and controls
31 lines (23 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//*****************************************************************************
//
// Author: Michael Price
// License: Attribution-NonCommercial-NoDerivs 3.0 Unported
// http://creativecommons.org/licenses/by-nc-nd/3.0/legalcode
//
//*****************************************************************************
#ifndef WIN32
#define NULL 0
#endif // WIN32
bool ambig (int i);
bool ambig (char * v);
void nothingness ()
{
int * _i = NULL;
int * i = nullptr;
int _j = NULL;
//int j = nullptr; // ERROR!!!
if (ambig(0)) { } // ambig(int)
if (ambig(NULL)) { } // ambig(int) when NULL=0
// ambiguous when NULL=0L
if (ambig(nullptr)) { } // ambig(char*)
}