You are here:

C++/problem in c++

Advertisement


Question
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

Answer
<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++.  

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


vijayan

Expertise

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.

Experience

about 15 years or so

Education/Credentials
post graduate engineer

©2016 About.com. All rights reserved.