Swap 2 ints with only 2 variables Explain the reason of pointer use in more primitive languages
Anonymous
// Swap with no temp void swap(int a, int b) { a = a + b; // a = 7 + 3 = 10 b = a - b; // b = 10 - 3 = 7 a = a - b; // a = 10 - 7 = 3 }
Check out your Company Bowl for anonymous work chats.