Null is undefined.
I'm confused. Visual Studio is flagging the NULL word as undefined. I thought NULL was a system constant for C++. Did something change or is there a replacement for NULL? I cannot even check if a variable is null in an if condition.
NULL is not a feature of C++.
Many libraries (including Windows), often include the code:
Depending on which headers you've included, NULL may or may not be defined as 0. If you want to use NULL (and not just use 0), but you haven't included one of these headers in your CPP file, you can just use the above code to define it yourself.
Many libraries (including Windows), often include the code:
#ifndef NULL
#define NULL 0
#endif
Depending on which headers you've included, NULL may or may not be defined as 0. If you want to use NULL (and not just use 0), but you haven't included one of these headers in your CPP file, you can just use the above code to define it yourself.
Please do not mark threads "solved" in this forum.
Prior to posting again, please be sure to read the forum rules and abide by them.
Thank you!
Prior to posting again, please be sure to read the forum rules and abide by them.
Thank you!
VC 2010 also supports the new C++0x [color="#0000FF"]nullptr keyword, which is a type-safe version of NULL or 0.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement