If you're going to do this with arrays, you're going to need a constant to define the size of the array.
constint MAX_STUDENT = 100;
Then declare studenta as an array.
Student studenta[MAX_STUDENTS];
You're going to need to keep track of the number of students read into each entry:
studenta[num_students++] = readStudent();
Not sure what you want to do with the course array.
@DTScode - new Course[sizeof(studenta)]
That going to allocate a number of occurrances of Course based on the byte size of a single Student instance. Probably not what you intended.
@AbstracionAnon Ive done it that way before, but I have to use the courses member variable. I cant just use a counter.
This is the prompt for the readCourseArray function:
-Use the student’s number of courses to set up an array.
-Prompts the user for information about each course the student has taken: the course name, the course number, the credit hours, and the student’s letter grade.
The code you have seems to be compiling fine on my computer. Only warning is that Course courseArray[studenta.courses]; is not being used. What error are you getting exactly?
g++ -Wall -W -o tempStu Stu.cc
Stu.cc: In function ‘void readCourseArray(Student)’:
Stu.cc:53:10: warning: unused variable ‘courseArray’ [-Wunused-variable]
Ok then what you have to do is either compile with the option -std=c++11
That will have no effect whatsoever. It's not any more legal in C++11 than it is in any other version of the standard. You can use the -ansi flag when compiling to disable nonstandard extensions if you're using a gcc variant.