[ create a new paste ] login | about

Link: http://codepad.org/EafccM3B    [ raw code | output | fork ]

C, pasted on Nov 13:
1
2
3
4
5
6
7
8
9
10
11
12
#include <stdio.h>

#define SWAP(x,y) ((y) ^= (x), (x) ^= (y) , (y) ^= (x))

int main(void)
{
int n1=24,n2=45;
int *np1 = &n1,*np2 = &n2;
SWAP(*np1,*np2);
printf("n1=%d,n2=%d\n",n1,n2);
return 0;
}


Output:
1
n1=45,n2=24


Create a new paste based on this one


Comments: