I am trying to swap between array and pointer in c++
My code is as the following :
void foo(int* a, int* b);
void main()
{
int *a = NULL;
int b[6]={2,3,5,6};
foo(a,b);
}
void foo(int* a, int b[])
{
int * c;
c=a;
a=b;
b=c;
}
While I return out from the Method nothing changed ,
within the method everything work fin but when the method return nothing change.
my question is:
A) what is my mistake.? B) How should I fix it.
void main(), it's time to swap that one.