In C++, can objects be null?
<p>Here's what I have done:
I've got a simple class:</p>

<pre><code>class Person{
  public:
    Person();
}

And in my main:

int main() {
  Person myPer = NULL;
}
</code></pre>

<p>This is impossible since C++ does not allow that, however:</p>

<pre><code>int main() {
  Person* perPtr = NULL;
  Person myPer = *perPtr; // corrected, it was &amp;perPtr(typo error) before answers
}
</code></pre>

<p>This compiles fine and as I see I did able to have a NULL object. So isn't it violating the rule that only pointers can be null in C++? Or is there such a rule in C++?
2nd one is after I wrote this code, I added a if statement checking whether myPer is NULL or not but that gave me error. So does it show that C++ does not really like the NULL object idea no matter what you do to make objects NULL...</p>
