Paul LaFollette wrote: > Kind people, > I am befuddled, and looking for understanding: > > int a, b; > a = 7; > b = 12; > > a ^= b; > b ^= a; > a ^= b; > > should swap the contents of a and b (and it does). > Since ^= associates to the right > > a ^= b ^= a ^= b; > > should do the same thing (and it does). > > However, if I access a and b through pointers, it breaks. > > int *p; > int *q; > > p = &a; > q = &b; > > *p ^= *q ^= *p ^= *q; I'd recommend you add -Wsequence-point to your command line options ;-) Johann