Poți să ai și obiecte pe nume NULL;
#undef NULL
int NULL;
Merge pentru că NULL este ceva de genu:
#if defined(__cplusplus)
#define NULL 0
#else
#define NULL ((void *)0)
#endif
Mai terminati cu C++-ul asta ca faceti omul (mai) confuz.
Sigur ca da, dar atunci s-ar putea sa ai surprize urate prin cod. NULL e prea folosit.
Da, cum ar fi :
if (NULL != NULL) {
std::cout << "if you can read this there must be a god" << std::endl;
}
in contextul :
class WeirdNullType {
public:
bool operator != (WeirdNullType& other) const {
return true;
}
};
#undef NULL
int _tmain(int argc, _TCHAR* argv[])
{
WeirdNullType NULL;
if (NULL != NULL) {
std::cout << "if you can read this there must be a god" << std::endl;
}
std::cout << "just kidding" << std::endl;
return 0;
}
Ups, nu m-am putut abtine nici eu.