Returning arrays

Jun 4, 2013 at 6:35pm
How would I return an array. Nothing gets passed through this code when I run it, I ran it using strings and it works, but will not with arrays. I am a beginner, so bare with me please if this is a stupid question.
Last edited on Jun 4, 2013 at 6:42pm
Jun 4, 2013 at 6:42pm
Functions may not have return type of an array (though they may return a reference to an array).
You have two approches. Either you dynamically allocate the array and return the pointer. Or you declare the array as a parameter of the function and pass to it already created array.
Topic archived. No new replies allowed.