Step 2 of 4
Attributes and encapsulation
Declare attributes in private so only the class controls access. Object users call methods instead of modifying fields directly.
class Mensaje {
private:
std::string texto;
};
Step 2 of 4
Declare attributes in private so only the class controls access. Object users call methods instead of modifying fields directly.
class Mensaje {
private:
std::string texto;
};