Hi, my assignment is asking me to include accessor functions that returns the values stored in each of an object of class Voter’s member variables respectively.

If the member variables are:
string ID;
int nr_times_voted;
bool voted;

Will the accessor functions be:

return ID;

return nr_times_voted;

return Voted;

Not sure I understand this exactly.
You'll need return types, just like in regular functions. The exception is that dtors/ctors do not return anything.

Also, try using code tages (the little button that says <>).
Topic archived. No new replies allowed.