Thursday 11 April 2013

Question: Is there any problem with the following: char *a=NULL; char& p = *a;?


Question: Is there any problem with the following: char *a=NULL; char& p = *a;?

Answer: The result is undefined. You should never do this. A reference must always refer to some object.

No comments:

Post a Comment