swapping with arrays in c code