What I want to do is make a grading system. There is a vector for schools and classes and students, all of these which have their own class, derived from a class called system.

class System{
School * p; //School Pointer
vector<School>sSort;
public:
    //Splash Screen Function
    void Splash();
};

/*-School Class High-*/
class School : public System{
public:

    /*-Variables of School-*/
    string schoolname;
    double averageGPA;

    /*-Functions-*/

};


/*-Student Class High-*/
class Student : public School{
};

What I want to be able to do is make there be many instances of the School class, and each school has its own body of students and would need its own vector sort, and each student has their grades, which I would also like to be "vectorized". How would I make vectors in multiple classes, I only really know how to do so in the main function.

Can you rephrase your question? i can understand it in parts but its not very clear what you have and what you want to do.

Well, class System HAS a vector of Schools. In other words, every System object contains a set of Schools.
But class School IS a kind of System (by inheritance). So every School has a set of Schools?!..
Hmm...

Member Avatar for jencas
/*-Student Class High-*/
class Student : public School{
};

Inheritance means an "is a" relationship, but you have a "has a" relationship. Try to understand the basics of OO before you begin to design classes.

I dont' really understand either, but maybe you just want to put a vector in the derived class instead of in the base class?

I'm guessing you're looking for something like this. You have a class School, each School having a specified amount of Student's.

class School
{
private:
String schoolName;
vector<Student> itsStudents;
public:
//Put functions here
//Like:
String GetName() const {return schoolName;}
};

class Student
{
private:
String name;
String adress;
int age;
vector<double> grades;
public:
//Functions here
};

You should look into the inheritance matter before using it. Your class definitions didn't make any sense at all.. You defined a Student to be a School. Like "a Student is a special case of a School", just like a "Square is a special case of a rectangle".

Hope this clarifies a bit.

commented: Good Comment +1
commented: Badass Post!!! +1

I figured it out on my own, but BeyondTheEye gave a pretty good description, REP!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.