I need to reverse large arrays such that the first element becomes the last, and the last becomes the first.
Until now I did this by creating a copy of this array, then iterate backwards over the original and write to the copy. After that, write the copy back to the original.
Is it possible to do this safely in one single loop by simultaneous access to the first and last element, storing one of them in a temp var and swapping the values?