Say in main I have:
and I have a function called set_numbers() where I want to set the values for the numbers in the array:PHP Code:
int nums[5];
set_numbers(nums);
that code works, but everywhere I read that you have to pass arrays by reference, and when I try to do that I get an error. Whats wrong with doing it how I'm doing it now, and how do I pass it by reference instead?PHP Code:
void set_numbers(int n[])
{
n[0] = 1;
n[1] = 2;
n[2] = 3;
n[3] = 4;
n[5] = 5;
}