in C++ classes, if I have a constant function (In my understanding constant functions are classes that cannot change anyting in the class, hope this is true) for example a function like this
int output(int value) const Am I allowed to call a function within this function remove that actually changes anything in the class?
For example lets say I have a variable called number in private.
my output function adds one to the variable number, but not directly, it calls a non constant function called addOne which adds one to the variable number. I notice that I am getting an error when a output function is calling addOne(I know that output function is const but it modifies a value, but it modifies it indirectly). I wonder why I am getting an error, what error compiler actually detects here?
Thank You, and sorry if my question is hard to understand.
Thank you all for answering.