cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Classes
Classes
Apr 3, 2013 at 11:42am UTC
nobodyza
(10)
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:
Voter::getID()
{
return ID;
}
Voter::getNr_times_voted()
{
return nr_times_voted;
}
Voter::getVoted()
{
return Voted;
}
Not sure I understand this exactly.
Apr 3, 2013 at 11:44am UTC
Bourgond Aries
(415)
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.