swapping elements between to arrays with eachother?
i have two size 5 arrays. the user types in two numbers, the first number represents the index of the first array that will be swapped and the second number represents the index of the second array that will be swapped (these two indexes will be swapped together). so say an array as the numbers [1,2,3,4,5] and the other has the numbers [6,7,8,9,10] and the user types in 2 and 4, then the new arrays will be [1,9,3,4,5] and [6,7,8,2,10].
this is the way i'm doing it:
printf("Enter index number in table_A to be swapped\n");
printf("Enter index number in table_B to be swapped\n");
tempInd = table_A[indexA];
table_A[indexA] = table_B[indexB];
table_B[indexB] = tempInd;
its not working though, whats wrong? thanks.