代码很简单,这里就不多废话了,直接奉上:
#include
using namespace std;
int* reverse(int* list, int size)
{
for (int i = 0, j = size - 1; i < j; i++, j--)
{
// Swap list[i] with list[j]
int temp = list[j];
list[j] = list[i];
list[i] = temp;
}
return list;
}
void printArray(int* const list, int si
1