Reputation: 1073
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
Upvotes: 2
Views: 134
Reputation: 111250
Did you include the appropriate headers i.e. <sstream>
for stringbuf
and <iostream>
for iostream
?
Upvotes: 7