I have a C++ class in which I have a constructer that takes char*,char*, ostream. I want to provide a default value for the ostream (cerr). Is this done in the header or the .cpp file?
I have a C++ class in which I have a constructer that takes char*,char*,
Share
You’ll need to make the parameter into a reference parameter, you shouldn’t try to copy
std::cerr. You probably need to specify the default parameter in the header file so that it’s visible to all clients of the class.e.g.