i need to implement a number class that support operator << for output. i have an error: "identifier "ostream" is undefined" from some reason eventhough i included and try also
here the header file:
Number.h
#ifndef NUMBER_H
#define NUMBER_H
#include <iostream>
class Number{
public:
//an output method (for all type inheritance from number):
virtual void show()=0;
//an output operator:
friend ostream& operator << (ostream &os, const Number &f);
};
#endif
why the compiler isnt recognize ostream in the friend function?
ostream
. There's onlystd::ostream
. – Cuss