#include <iostream>
using namespace std;
void main()
{
int x[3] = {5,2,4}:
swap(x,1,2);
}
void swap(int[] list, int i, int j)
{
int temp = list[i];
list[i] = list[j];
list[j]= temp;
}
I am trying to figure out what this means, I get the passed by value. However I am not too familiar with pointers and value-results? Will some one explain or point me to an example dealing with C and the methodologies below?
- Argument x is passed by value.
- Argument x is passed by reference.
- Argument x is passed by value-result.