aboutsummaryrefslogtreecommitdiffstats
path: root/crazy-swap.c
blob: e06136a1bc71ac81d75a9c57b59b4eb1ae59a20f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
static inline void swap(int *a, int *b)
{
        *a=*a^*b;
        *b=*b^*a;
        *a=*a^*b;
}

int main(int argc, char **argv)
{
        int i;
        for (i = 0; i < 999999999; i++) {
                int a = 2;
                int b = 123;
                swap(&a, &b);
        }
        return 0;
}