I have implemented a write function for my class but iam getting error:
class Fa{
private:
string Q_;
string F_;
public:
void write(ostream& out = cout) const{
out<<Q_<<endl;
out<<F_<<endl;
}
};
Error:default argument given for parameter 1 of `void Fa::write(std::ostream&) const’
Can anybody please tell me what does this error mean and how could i avoid it?
You are missing includes and namespaces:
If you have a header and a cpp file, in the header file specify the default argument:
and in the cpp file do not: