User-defined functions and arrays

Mar 25, 2013 at 11:48am
I need help with this:

Write a function that takes two parameters, an integer array and its size. The function should compute and return the number of odd integers in the array, the number of even integers in the array, and the average of all the integers in the array.

If someone could walk me through the solution I'd be very grateful, I understand nothing -cries-
Last edited on Mar 25, 2013 at 11:50am
Mar 25, 2013 at 11:52am
You should try something by yourself. And if you have some problems with code, somebody will help you.
Mar 25, 2013 at 11:54am
That is the issue, I've tried tutorials, etc.
I just can't wrap my head around return functions or implementing arrays into user-defined functions.
I'm not asking for a simple copy paste solution, I want an explanation to how to solve this question.
Mar 25, 2013 at 11:59am
About your question. As I know function could return only one value. You should write few functions to return all that stuff.
Mar 25, 2013 at 12:04pm
The question stressed the fact that it requires 1 function, another reason why I am lost.
Mar 25, 2013 at 12:22pm
There's quite a bit of discussion about that here:

http://www.cplusplus.com/forum/beginner/18489/
Topic archived. No new replies allowed.