Putting a Function return into array

I'm stuck on a simple thing. I have a function that outputs an integer. I need to put that output in an array. Will this work?

sum[] = funcSum();

I want the value to go into the next available array slot whose value isn't 0. Do I need a loop to do that?

Also, when the value is placed in the array, does the next value that's entered via this function get placed in the next available array slot?

I'm staring at the pages of my book, but can't see this. A little help would get me moving again.

Thanks all.

You can only assign one value at a time.
If you want to fill the array sum with values returned by funcSum,
1
2
for(int i = 0; i < /*size of sum*/; i++)
   sum[i] = funcSum();
It was all over the pages of my textbook, in the examples, everywhere. It was rain, and I was only seeing the space between the drops. Arggh.
Thanks, that fixes me.
Topic archived. No new replies allowed.