Hi Robert. In C++, there is no way to know the length of an
arbitrary array. So, num.length is something you can do in
Java but not in C++. A vector is a data structure that is
essentially a growable array. The vector class overloads
some operators, one usually expects for a array. This is
why it works like an array. The internal implementation is
an ordinary array, except for the fact that if you run out
of space to insert an item, then it will grow larger. I am
not sure how else I could phrase it.
As an exercise for yourself, I suggest you attempt to
implement such a data structure in C++. If you get stuck,
then just take one problem at a time.
--- Robert Ryan <[EMAIL PROTECTED]> wrote:
> i will start over, thanks:
>
> for (int i=0; i<num.length; i++) {
> total += num[i];
> }
> cout << "The total is "<< total << endl;
> }
>
> how is a vector diff from an array:
>
>
> ---------------------------------
> Expecting? Get great news right away with email
> Auto-Check.
> Try the Yahoo! Mail Beta.
_________________
Joseph A. Marrero
http://www.l33tprogrammer.com/
____________________________________________________________________________________
Have a burning question?
Go to www.Answers.yahoo.com and get answers from real people who know.