Garmaine Staff asked 9 years ago

I need to read in an array to my function, extract the data, and then return an array from the function.

The array will only ever hold 2 values.

This is what I want to do in concept:

int myfunction(int my_array[1])
{
    int f_array[1];
    f_array[0] = my_array[0];
    f_array[1] = my_array[1];

    // modify f_array some more

    return f_array;
}

I've read up about pointers etc but have got very confused and would appreciate a really basic example of how best to approach this!

Thanks!