User Profile
Collapse
-
Oh. Dear, I got the solution. I inserted wrong headerfile. Sorry for misleading and thank you for help. -
assets are vector <int>. Sum should be total of the array. But it not working. whats wrong with this code please help.
Code:vector <int> assets; int sum = accumulate(assets.begin(), assets.end(), 0);
Leave a comment:
-
pcbabu started a topic What kinda error is this 'UnfairDivision::albertsShare' : must return a valuein CWhat kinda error is this 'UnfairDivision::albertsShare' : must return a value
I got this error message:
Error 2 error C4716: 'UnfairDivision ::functionName' : must return a value d:\work\tc\tc\c ode.cpp 30
Why this error happens. Please help. I'm trying to use accumulate() of stl.
Thanks in advance.Code:int sum = accumulate(assets.begin(), assets.end(), 0);
-
loop goes like bellowCode:Hello World.
but the cursor is already ahead of your input. Here it doesn't go backward. cout prints in cursor position so input is like that.Code:takes input H and print - takes input e and print - takes input l and print - takes input l and print - ... ... takes input \n and print -
Leave a comment:
No activity results to display
Show More
Leave a comment: