示例
#include
<iostream.h>
#define
NULL 0
bool
function(
int
*input){
if
(input == NULL){
return false
;
}
else
{
return true
;
}
}
解决方案
始终将 NULL 定义为 (void *) 0。
#include
<iostream.h>
#define
NULL (void *) 0
bool
function(
int
*input){
if
(input == NULL){
return false
;
}
else
{
return true
;
}
}