I'm trying to make a program to allow me to enter information(mainly books) in to a sort of library. I read that <list> is an easy way to add things and sort them.

Also by use a hierarchy I can use my base class and just add on to each different type of item i wish to add. Is there a sample code or tutorial to help me with this?

What types of items do you want to be derivities of a base class? Such as books, movies, newspapers, broadway plays, etc. ?

<list> is similar to normal linked lists. <vector> is like an array. Which to use depends on what you want to do with them. And both are far superior to the C counterparts (linked lists and array).

i plan on doing

class Data


class video :: class Data

class video:: class magazine

as for the <list>

I plan on storing each of the books, movies and mags

I read up on it and its easier to use by using push. instead of having to set the space to null increasing it and what not

you might want to use a vector

vector<Data*> theList;
magazine* n = new magazine;
video* v = new video;

One problem in the above is you need some method to distinguish the class types when extracting them from the vector. Is theList[0] of class magazine or video? You might want an indicator (integer) in the base class.

theList[0] = data(a book)
theList[1] = video
theList[2] = mag

class video:: class magazine

should be

class magazine : public data