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:
int table_A[5];
int table_B[5];
int indexA;
int indexB;
int tempInd;
printf("Enter index number in table_A to be swapped\n");
scanf("%d", &indexA);
printf("Enter index number in table_B to be swapped\n");
scanf("%d", &indexB);
tempInd = table_A[indexA];
table_A[indexA] = table_B[indexB];
table_B[indexB] = tempInd;
its not working though, whats wrong? thanks.