When I compile some old source code downloaded from Internet, I sometimes encounter the problems with
#include <fstream.h>
#include <iostream.h>
The g++ compiler in cygwin claims the following errors:
In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/fstream.h:31,
from decode.cpp:5:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
in a class like that:
I changed the header files as:Code:class e { public: e(istream&f); ..... }
#include <fstream>
#include <iostream>
But the g++ still says:
decode.cpp:37: error: expected `)' before '&' token
decode.cpp:55: error: ISO C++ forbids declaration of `istream' with no type
What can I do to fix this problem? Thanks