P
pauldepstein
From a website:
25. Is there any problem with the following:
char *a=NULL; char& p = *a;?
The result is undefined. You should never do this. A reference must
always refer to some object.
I'm a bit puzzled. I would have said there are two problems. One is
mentioned on the website. However, isn't there another problem --
that it's wrong to dereference a null pointer?
Thanks,
Paul Epstein
25. Is there any problem with the following:
char *a=NULL; char& p = *a;?
The result is undefined. You should never do this. A reference must
always refer to some object.
I'm a bit puzzled. I would have said there are two problems. One is
mentioned on the website. However, isn't there another problem --
that it's wrong to dereference a null pointer?
Thanks,
Paul Epstein