wstring is not a pointer, it cannot be null. You can check if it's empty (that is, is equivalent to "") either by direct comparison to the previous, or by:
In a recent code review, a contributor is trying to enforce that all NULL checks on pointers be performed in the following manner:
int * some_ptr;
// ...
if (some_ptr == NULL)
{
// Handle null-pointer error
}
else
{
// Proceed
}
instead of
int * some_ptr;
// ...
…
I know that in C++ 0x or NULL was replaced by nullptr in pointer-based applications. I'm just curious of the exact reason why they made this replacement?
In what scenario is using nullptr over NULL beneficial when dealing with pointers?
I get this message when compiling C++ on gcc 4.3
error: ‘NULL’ was not declared in this scope
It appears and disappears and I don't know why. Why?
Thanks.