You're not including the standard headers for istream and ostream, and/or not getting them into the correct scope.

What tutorial are you going by? This code has many other errors, too.