Hi, I have to create a funtion of a cumulative sum, in which the argument a is added to the argument b and c=a+b and I have three headings to choose from, explaining which of them would work and writing a program if it does.
a) void cumul(int *const a, int *const b, int*const c)
b) void cumul(const int *a, const int *b, const int *c)
c) void cumul (int &a, int &b, int &c)
but I have no idea of how to call a) and b) and if they would work, because they take const values! Thank you for your help!
Thanks for the quick answer! I was thinking about that, the easiest way to do it would by with c), but is there a way of copying the pointers and changing the values for a) or b)? I would guess it would only work for b), because you said that the pointers could be changed