[prog] C++ Inheritance

Sue Stones suzo at bigpond.net.au
Fri May 23 23:18:57 EST 2003


I am looking at inheritance in C++ and am making sloww progress!

I am trying to write a class that is a extention of fstream called 
fstream_ext.  If I have the termanology right fstream is the base-class.

First up I am having dificulty with the constructor, the compiler gives me 
the error message that only a constructor can be decalred explicit. S

 explicit  Fstream_ext::Fstream_ext(const char *filename,
                openmode mode=in|out)
        :fstream(filename, mode=in|out)
 {
        _fname = filename;
 } //constructor

Could someone explain what it is that I have misunderstood here?

thanks 

sue


More information about the Programming mailing list