Basically i have 3 classes derived from and abstract base class. In my main i have a switch case statement with three case's one for an object created of each class type. I have a function which is pretty much identical for in each of the cases in my main and i would like to instead declare it within the classes using a pure virtual function in my abstract base class.
ostringstream ofss;
ofss <<" "<<clec<<" "<<cgrade<<" %"<<endl;
string outputFilename(ofss.str());
(clec and cgrade are previously declared)
This is few lines of code i have in my main of which i wish to write as a function inside my classes, and the pure virtual function of it declared in abstract base class, which will simply when called return a string.
Would really appreciate anyhelp as i have tried so many different ways of writing the function and i can't seem to get it to work.