October 26, 2024
Chicago 12, Melborne City, USA
C#

I just don't understand this pointer case


This is my code:

int *p;
p = 4;
printf("p is %p\n", p);
free(p);
// Need p=NULL, but I don't
int *q;
q = 5:
printf("q is %i", *q);

Then the error comes.
I just need an explanation for it.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video