Hey, I need to make a function that returns an array. How would I do so? And how would I make a variable that gets all the values in that function? Thanks, you guys :)
glut
0
Light Poster
Recommended Answers
Jump to PostAs far as I know you can't return a C-type array (e.g. myarray[100]), but you can return a std::vector, like so:
vector<int> myfunction(void)
Then, once you need the result, you would do something like this:
vector<int> someInts; someInts = myfunction();
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.