--- Robert Ryan <[EMAIL PROTECTED]> wrote:
> I will go over that code again. i can't see any
> reason that it should give an answer like -20. that
> answer must have come from something else...........
> 
> "Victor A. Wagner Jr." <[EMAIL PROTECTED]> wrote:    
>      At 18:21 2007-02-04, Robert Ryan wrote:
>   ok, correct.............
> it was at the end of the messsage
> 
> 
>   "Victor A. Wagner Jr." <[EMAIL PROTECTED]> wrote: 
>     
>    At 10:33 2007-02-04, Robert Ryan wrote:
>     
>    what would make it look better.
>   
>    you mean correct?
> 
> 
>     
>    "Victor A. Wagner Jr." <[EMAIL PROTECTED]> wrote: 
>    
>    At 18:48 2007-02-03, Robert Ryan wrote:    
>    int array_one[ 25 ];   
>    > > int *array_two = new int[ 25 ];
>   
>       
>    if you wanted to total up the ints, how would you
> do it.   
>    for(int i=0; i<array_one; i++) {   
>    total += array_one [i];   
>    and then cout << "The total Is:  " <<;  }  
>    no, not even close
>   
>    what is  "i<array_one" supposed to do?
>   
>    #include <iostream>
>   
>    #include <numeric>
>   
>    using namespace std;
> 
>   
>    int main()
>   
>    {
>   
>            int array_one[25];
>   
>            /* some code to put stuff in array_one */
>   
>            int total = accumulate(array_one,
> array_one+25, 0);
>   
>            cout << "The total is: " << total <<
> endl;
>   
>    }
> 
> 
>   
>    [deleted]
> 
>     Victor A. Wagner Jr.      http://rudbek.com
> The five most dangerous words in the English
> language:
>               "There oughta be a law" 
> 
The values in array_one could be anything.  It just
goes out and grabs memory, and the values are whatever
was in there when it was grabbed.  To make some
meaning you could do:
int array_one[25] = {0};
which would initialize all values in the array to 0.

Ray


 
____________________________________________________________________________________
Have a burning question?  
Go to www.Answers.yahoo.com and get answers from real people who know.

Reply via email to