So I have a variable I often have to call outside the class, I was told that I should do this:
class Foo{
public:
//stuff
Type getVariable();
private:
Type Variable;
//stuff
}
But why can't I just use:
class Foo{
public:
//stuff
const Type variable
private:
//stuff
}