Skip to content

Instantly share code, notes, and snippets.

@xnuk
Created May 1, 2014 18:33
Show Gist options
  • Save xnuk/dc4342f9d5ea7160431e to your computer and use it in GitHub Desktop.
Save xnuk/dc4342f9d5ea7160431e to your computer and use it in GitHub Desktop.
#include<stdio.h>
main()
{
int a=10, b=20, t;
int *pa=&a, *pb=&b;
t=*pa;
*pa=*pb;
*pb=t;
printf("%d %d\n", *pa, *pb);
a=10, b=20, t=NULL;
*pa=&a, *pb=&b;
t=*pa;
*pa=*pb;
*pb=t;
printf("%d %d\n", *pa, *pb);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment