Initializing array with function return value

Alright so I've got a function that creates an array that I need passed back to main(). How do I go about doing this and using this array as I would any other? It's giving me a hell of a headache and stopping me from finishing this assignment.
closed account (zb0S216C)
Do you know the length of the array?

Wazzak
Yea I do, it's a value known at compile time.
closed account (zb0S216C)
Why not pass the array (from "main( )") by reference then modify the array within the function. That way, you don't have to return anything.

1
2
3
4
5
void ModifyArray( int( &Array_ )[4] )
{
    for( /* each element in Array_... */ )
        // Do something.
}

Wazzak
Ah that is much smarter haha. Worked perfectly.
Topic archived. No new replies allowed.