Jeungwoo Park Jeungwoo Park - 1 year ago 86
C Question

can i see what value of pointing NULL pointer?

int main() {
int *p=NULL;
if (p == NULL) {
printf("%x",*p );
return 0;

If I can, How?
If I can't, What value in it?

Answer Source

No, you cannot in general dereference a NULL pointer, that gives undefined behavior.

That's sort of the point, so this idea is a bit strange.

Note that this doesn't mean that your code won't run on any platform or produce a result, but it still violates the language specification so the result from running it on some particular implementation doesn't matter.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download