Skip to content
Snippets Groups Projects
pointer_copy_memcpy.c 166 B
Newer Older
Andre Maroneze's avatar
Andre Maroneze committed
int x=1;
int main() {
  int *p = &x;
  int *q;
  memcpy (&q, &p, sizeof p); 
  *q = 11; // is this free of undefined behaviour?
  printf("*p=%d  *q=%d\n",*p,*q);  
}