- Joined
- Jun 14, 2006
- Messages
- 3,031
- Reaction score
- 4
I have this...
incase you are wondering, this is just a little project for my CS1C class.
Code:
class Student
{
public:
(blah blah blah)
private:
string studentName;
int strudenAge;
string studentId;
};
class GradStudent : public Student
{
public:
(blah blah blah)
private:
string academicMajor;
float grantAmt;
bool teachAssist;
};
(where the errors are)
void GradStudent::SetGradInfo(string major, float grant, bool ta, string nm, int ag, string stuId)
{
academicMajor = major;
grantAmt = grant;
teachAssist = ta;
(error: illegal access to protected/private member)
studentName = nm;
(error: illegal access to protected/private member)
studentAge = ag;
(error: illegal access to protected/private member)
studentId = stuId;
}
incase you are wondering, this is just a little project for my CS1C class.