C++ : [Error] ‘ostream’ does not name a type

using  std::ostream;

The IO library is in STD, so you should declare it before using it

Read More: