Re: what is different between <fstream.h> and <fstream>MS VC++

From: Old Wolf (oldwolf_at_inspire.net.nz)
Date: 01/28/04


Date: 28 Jan 2004 12:11:38 -0800


> > > I habe some error in my programm,because i use <fstream.h>,I want to
> > > use <fstream> but i donīt know which fonctions i must modify in my
> > > program ?
>
> yes i am writing 'using namespace std ;' and the errors are
>
> error C2228: left of '.open' must have class/struct/union type
> error C2228: left of '.eof' must have class/struct/union type
> error C1903: unable to recover from previous error(s); stopping
> compilation
> Error executing cl.exe.
>
> and my header file is here:
>
 
#include <iostream>

> #include<fstream>
> #include<string>
  (etc.)

You might find that you need
 #include <istream>
and/or
 #include <ostream>
too.