I am supposed to be using Array of Pointers to student Objects hence i was doing s[0]->Student_Id.
Also another error i get is the course class not being able to access s[0]->Student_Id because Student_Id is declared as Private??
Also how do i call it in the main class? like this?
for (i = 0; i < Total; i++) {
course.addStude nt(&s);
}...
User Profile
Collapse
-
Thanks...
I also intialized using a constructor like below:
Code:Course::Course(int Student_Id,string Name) { this->Student_Id = Student_Id; this->Name = Name; // students = NULL; num_students = 0; }
Now, I also tried to access the objects of the student class inside this function but it throws an error like
[C++ Error] course.h(50): E2288...Leave a comment:
-
Help with Classes
Hi,
I am Supposed to be reading from a student file and store it in array of pointers to student Objects(Objects of Student class).
The file contains data like:
102022 Jonathan James L
Dayton, Ohio
775665
M 2 25 2.5
ENGR
Where the 1st line contains the student id, first name, last name. 2nd line is the home town.3rd line is the phone number,4th line contains Sex, Year,...
No activity results to display
Show More
Leave a comment: