Use a loop and sum all the values yourself.
You might also use some of the STL stuff from functional, but that's probably a bit advanced for this stage.
Just as a matter of curiosity, who taught you all those DOS commands ("pause", "cls", and "title")? Bane of secure programming, they are.
Try reading the errors. They tell you what's wrong with the code.
If you don't understand them, post them here and we can explain them.
Last edited on
There's a small but important error on line 42. Moneysaved is using the wrong variable.
Edit: variable b on line 18 isn't declared.
Last edited on
for (x=='n' || x=='N')
should be:
if (x=='n' || x=='N')
AND
for (int y=0; y=<moneysaved.size(); y++)
should be:
for (int y=0; y<=moneysaved.size(); y++)
Also, you have dropped your declaration of b. That should do it.
why moneysaved is using wrong variable?
int i = stands for what is stored in the vector... :s