Question-function/array

I've been self teaching myself c++ and came across a question about arrays.Here's the function i wrote:

scramble(int a[], int n, int b[]){
int num_in_a=n;
for(int i=0, i>n, ++i)
int j=rand%num_in_a;
b[i]=a[j];
a[j]=a[num_in_a]
--num_in_a;
}


Is it possible to implement this function to use only one array, (a[]) instead of using both a[] and b[].
such as scramble(a,n,a)
Topic archived. No new replies allowed.