Skip to content

Instantly share code, notes, and snippets.

@abhishekbhardwaj
Created October 26, 2012 19:25
Show Gist options
  • Save abhishekbhardwaj/3960900 to your computer and use it in GitHub Desktop.
Save abhishekbhardwaj/3960900 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(void) {
int m = 11, n = 22;
int *p = &m, *q = &n; //11, 22
printf("%d %d\n", *p, *q);
int **pp = &p, **qq = &q; //11, 22
printf("%d %d\n", **pp, **qq); //
int *r = *pp; //11
*pp = *qq; //22, 22
printf("%d %d\n", *p, *q);
*qq = r; //22, 11
printf("%d %d\n", *p, *q);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment