I believe I'm having an error with initializing my dynamic array -data-.
I'm not 100%, but the sum value comes out to be 0 when the program is run, and it's my best guess. However, I've tried initializing it in a bazillion ways and nothing changes. Is it even an initializing problem?
-It should be the accumulation of all array elements-
is what I was going to say.
But I just realized that -items- only sets the size of the array. It doesn't actually store anything in array. So initializing it the way I did is setting everything to zero isn't it? Then it's adding up a bunch of zeroes.
to clarify newint[items]{} initialise all the elements to 0 newint[items] (note the lack of braces) doesn't initialise the elements, they have whatever value was at that memory address.