Class atributes - memory class

Hello all!

We had test in our class about some things in C++. As I'm beginner, I can't surely answer one question and after time spend on googling it, I'm still not sure.

The question was: In class, we can specify memory class for attributes by:
a) mutable
b) extern
c) auto
d) inline

My opinion: Well, ok. It is not inline. Mutable is to mark attribute as we can change it with constant instance - so it is not mutable. Extern it could be, but it is for global space. I'll personally choose c) auto.


My teacher opinion (regarding to text in his presentation): Correct answer is a) mutable.

----
Can you please explain me, why mutable is correct? Thank you and have a nice day!
Topic archived. No new replies allowed.