Write a function named switch_pairs
that accepts an array of strings and a length as parameters and switches the order of pairs of values in the array.
Your function should swap the order of the first two values, then switch the order of the next two, and so on.
For example, if the array stores:
char* a[7] = {"a", "bb", "c", "ddd", "ee", "f", "g"};
switch_pairs(a, 7);
Your function should switch the first pair ("a", "bb"), the second pair ("c", "ddd") and the third pair ("ee", "f"), to yield this array:
{"bb", "a", "ddd", "c", "f", "ee", "g"}
If there are an odd number of values, the final element is not moved.