You access class members using the dot operator on an object. If you have a Student object named s, write s.name to access the name member variable or s.getName() to call a member function.
The dot operator works with both public member variables and public member functions. You can read values, assign values, or call methods the same way you access struct members. Private members can't be accessed with the dot operator from outside the class.
Trying s.privateVar causes a compile error. This restriction enforces encapsulation and protects internal data.