In your class Exam : module , venue and date are private members, access to which is possible only within this class. Even if you change the access modifier to public :
class Exam { public: string module,venue,date; }
these are elements that are associated with specific objects (instances of this class), and not with the class definition itself (for example, static members). To use such elements you need an object:
Exam e; e.date = "09/22/2013";
etc .. Also note that module,venue,date = ""; doesnβt change module and venue in any way, what did you really mean:
module = venue = date = "";
although std::string objects are initialized automatically for an empty string, so this string is useless anyway.
source share