I want to use a class in C++ that has an integer array like this:
class A{
private:
int arr[50];
}
I will read something from text file like this:
sum i1 i2
That means: Sum of arrays index1 and index2 and store in index1.
How can I do it, with using getters and setters like:
seti2(geti1()+geti2())
or something like that, (because it's not very useful, I don't want to write getter and setter for every index geti1() geti2() ... geti50())
Do you have any idea?
By the way, my second question is that, is getter should not have any parameters and is setter should have only one parameter?