The following code is used to swap numbers in an array. However I just found out that it has to be in pointer notation. I have been trying several ways with the indirection operator, but I cannot seem to get it to compile... Any suggestions would be a great help thanks! Here is my code:
temp = my_code[0];
my_code[0] = my_code[2];
my_code[2] = temp;
temp = my_code[1];
my_code[1] = my_code[3];
my_code[3] = temp;
By the way, I am doing this in a function which uses pass by reference if that means anything?