You are here:

C++/problem in c++


what to do if an error "unable to open file iostream .h" is displaying and how to change or correct the path to resolve this error

<iostream.h> is  not (and never has been) a standard C++ header.

many compilers still support it (for compatibility reasons, it is a header that was in use before the IS for C++ was adopted). not all compilers have it (and as newer versions of compilers are released, more and more compilers are doing away with it).

and among the ones that do have <iostream.h>, the semantics vary. with some compilers, <iostream.h> provides standard iostreams with using-declarations added. there are others where <iostream.h> gives "classic" iostreams instead of standard iostreams, and these may not interoperate with the rest of the standard library.

if you change the #include for the header to follow the C++ standard:

       #include <iostream>  
       using std::cout ;
       using std::cin ;
       using std::endl ;
       // etc

       // or alternatively
       // using namespace std ;

you should be able to compile and run your program with any
compiler that claims even modest conformance to the international standard for C++.  


All Answers

Answers by Expert:

Ask Experts




my primary areas of interest are generic and template metaprogramming, STL, algorithms, design patterns and c++11. i would not answer questions about gui and web programming.


about 15 years or so

post graduate engineer

©2017 All rights reserved.