I have a code similar to the following:
class News {
public:
virtual void get() = 0;
}
class Cnn : News {
void get () {...}
}
class Msnbc : News {
void get () {...}
}
class Bbc : News {
void get () {...}
}
main ()
{
News * news = new Cnn;
news->get ()
News * news = new Msnbc;
news->get ()
News * news = new Bbc;
news->get ()
}
Instead of creating each sub-classes, what is the best way to store the sub-classes (Cnn, Msnbc...) and iterate over and get a news from all of the feeds (I can't use STL at a moment)
Thanks