Hi, I'm writing a small project and since I'm new to pointers I've been having troubles passing an array to a function by reference.
Say:
1 2 3 4 5
int Array_data[2]={1,2};
//and I need to pass the array above to a function "solution"
solution(&array_data);
// isn't working, say the function receives it this way
// solution( int *new_array[])
What I'm doing is this:
Instead of copying the whole array from function_1 to function_2, all I wanna do is pass the address of the array in function_1 to function_2, so that I'd be able to access and change(where needed) the content of that array in function_1 in function_2.