I have declared both a
class myclass
{
private:
stringbuf* mbuf;
iostream* mios;
};
in my class .h header file. however when I try to initialize them in my constructor like so:
myclass::myclass()
{
mbuf = new stringbuf();
mios = new iostream(mbuf);
}
it throws an error along the lines of:
invalid use of incomplete type 'std::stringbuf'
and then of course the iostream complains about not being able to use the stringbuf
Did you include the appropriate headers i.e.
<sstream>forstringbufand<iostream>foriostream?