0

Compiling this program gives me an error:

int num = 10, *ptr = &num, **ptr2;
*ptr2 = ptr;
printf("ptr -> %p\nptr2 -> %p", &ptr, &ptr2);

Why can't I get the address of ptr2, and what does *ptr2 = ptr even mean? What will be contained in ptr2 if *ptr2 = ptr?

kuro
  • 3,214
  • 3
  • 15
  • 31

0 Answers0