kosmic_chic
2011-04-26 04:13:42 UTC
Question:
Write the definition of a function reverse , whose first parameter is an array of integers and whose second parameter is the number of elements in the array. The function reverses the elements of the array. The function does not return a value.
I don't understand where I'm going wrong in this one... I will appreciate any help. Here is what I have so far:
void reverse( int array[], int size)
{
int x, y = 0;
for (x = 0; x < size; x++)
{
y = array[x];
array[x] = array[size - 1 - x];
array[size - 1 - x] = y;
}
}