can a class variable be read only? if so how is it done? Karl Pietri
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
class MyClass{
public:
//...loads of hardcore code
int getVariable()const{return variable;}
private:
int variable; //your data variable
};
void MyClass::setVariable(int newValue){
variable = newValue;
}