So basically my code should output "1" becasue there is only one cs400. I can only get my code to output 1 if I put cs400 first where math195 currently is. When looking through the debugging I noticed that my pointers were not saving how I thought they should. I thought they would work something like this: math195->cs350->cs400->cs310->GenEd (s7->s3->s5->s1->GenEd) but in reality its end up like cs350->SCourses, cs400->SCourses. Is there something wrong with me doing s1 = *s2 thats not correctly working? Hopefully my question isnt too confusing.
The problem is that you're "slicing" your objects when you copy them into the data members, because those data members are all SCourses objects. When you're doing, for example, s1 = *s2, s1 is nothing more than an SCourses object, and calling s1.count_cs400() is just going to return zero.
If you want to use polymorphism, you'll need to use pointers to SCourses, not objects. You'll also need to think about where you need to make your methods virtual.