Still not getting it

Oct 27, 2014 at 12:24am
If I am to write a client function that computes the sum of integers in the aBag, is an array used if I do not know how many items, or what the items are?

Also, I get that the "client" is going to be the actual program. So that means the function just states what I am going to do????
Oct 27, 2014 at 9:04am
if you don't know the number of items during compile time you may use a dynamic array or a standard container like vector:

http://www.cplusplus.com/reference/vector/vector/?kw=vector

vector (like most other container) has a member function size() which tells you how many items the container actually contains.

So that means the function just states what I am going to do????
I don't understand this question. Functions are what a program represents
Oct 27, 2014 at 8:29pm
THANK U CODER777
Topic archived. No new replies allowed.