none
Cannot find <iostream.h> in using Visual C++ 2008 Expression Edition

    Question

  • I downloaded the Visual C++ 2008 Express Edition two days ago and used it to wrote a ccp program where a header file of <iostream.h> was included. After Building, I got a fail message: 'iostream.h' is not found'  No such a file or directory. I tried download MSDN Libery then, but still had the problem. My computer runs Microsoft XP. Could anybody help?

     

    Sunday, March 28, 2010 2:46 PM

Answers

All replies

  • Hello Xiao Jun,

    The <iostream.h> header is deprecated in standard C++ in favor of <iostream>. See the section "Differences in iostream Implementation" in the following MSDN documentation :

    http://msdn.microsoft.com/en-us/library/8h8eh904(VS.80).aspx

    - Bio.

     

    • Proposed as answer by Matt Pritchard Monday, March 29, 2010 10:28 AM
    • Marked as answer by Nancy Shao Tuesday, March 30, 2010 6:50 AM
    • Marked as answer by Nancy Shao Tuesday, March 30, 2010 6:50 AM
    Sunday, March 28, 2010 3:01 PM
  • Hi Xiao Jun,

    Using

    #include<iostream>

    using namespace std;

    instead of #include<iostream.h>, it's old syntax.

    Best Regards,

    Nancy


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, March 30, 2010 6:52 AM
  • well, i have the same problem... and I used #include<iostream> and it doesn't work either...

    why did microsoft erase the iostream.h library, all the old c++ manual have that library and nothing works... very disapointed

    Tuesday, February 08, 2011 7:17 PM
  • why did microsoft erase the iostream.h library, all the old c++ manual have that library and nothing works... very disapointed


    Your old C++ manual is out-of-date. The correct header is <iostream>.

     

    Tuesday, February 08, 2011 10:50 PM
  • >I used #include<iostream> and it doesn't work either...

    What *exactly* does "doesn't work" mean?

    What errors are you getting?

    Did you also add this line?
    using namespace std;

    >why did microsoft erase the iostream.h library

    To conform to the ANSI/ISO C++ Language Standard.
    All contemporary C++ compilers have done the same.

    - Wayne
    Tuesday, February 08, 2011 11:11 PM
  • ok, i've tried it again and my manual was out of date, for using the iostream library I have used "using namespace std" like:

    #include <iostream>

    using namespace std;

    int main () { and whatever...

    what does the void main (void) means? because it doesn't work either now...

    Friday, February 11, 2011 12:00 PM
  • ok, i've tried it again and my manual was out of date, for using the iostream library I have used "using namespace std" like:
     
    #include <iostream>
     
    using namespace std;
     
    int main () { and whatever...
     
    what does the void main (void) means? because it doesn't work either now...
    "void main(void)" means the same as "void main()": a function that has no parameters and returns no value.
     
    But in the case of the main() function, both are wrong (though I think Visual C++ will accept them).
     
    It should be "int main(void)" or "int main()". In C++, if you do not specify a return value in main(), then the compiler will return zero.
     
    If your code is not working, you need to explain in what way, or nobody can help you.
     
    I sounds as if you could use a more up to date book. Learning from an outdated book is just not a good idea.
     

    David Wilkinson | Visual C++ MVP
    Friday, February 11, 2011 12:16 PM
  • gotcha... manuals of c++ in internet with the new libraries etc. are difficult to find though... i've looking for them and I just find manual out of date with the old way to do things...

    If somebody knows about some manual it would be awesome :D

    thanks for the help

    Friday, February 11, 2011 5:35 PM
  • If somebody knows about some manual it would be awesome :D

    There is quite a bit of useful material online for learning C++.

    Here are a few links:

    Getting Started in C++
    Online eBook: Thinking in C++
    C++ Language Tutorial
    C++ Beginner's Guide
    C++: The Complete Reference, 4th Edition
    The C++ Programming Language
    Code Examples: CodeProject
    Code Examples: CodeGuru
    Friday, February 11, 2011 5:59 PM
  • whats for the

    return (0) at the end?

    Sunday, February 13, 2011 12:11 PM
  • whats for the
     
    return (0) at the end?
    I think you need to read some of the material before you ask any more questions. There is no end to questions like this. But
     
    return (0);
     
    or (more commonly)
     
    return 0;
     
    just measns that the function returns the value 0. For the case of the main() function, this value is returned to the operating system. Contrary to C or C++, a return value of 0 usually indicates success, while a non-zero value denotes some kind of failure.
     

    David Wilkinson | Visual C++ MVP
    Sunday, February 13, 2011 12:20 PM
  • I tried the exact same thing. Auto-correct didn't find any mistakes, still I wasn't able to build the app.

    this is the whole thing :

     

     

    #include <iostream>

    using namespace std;

    main ()

    {

    int v[100] ,n, i;

    cout<<"number of components"; cin>>n;

    for (i=0;i<n;i++)

    {

    cout<<

    "v["<<i+1<<"]=";

    cin>>v[i];

    }

    for (i=0;i<n;i++) cout<<v[i]<<endl;

    }

     

     

     

     

    THANKS (:

     

    Monday, July 04, 2011 2:55 PM
  • You should have started a new thread for your problems,
    rather than tacking them onto the end of an old thread
    which has already been marked as "Answered". Your problem
    may not be the same.

    You should also describe *exactly* what the errors are.
    Just saying: "I wasn't able to build the app." tells
    us nothing useful.

    For starters, you *must* provide the return *type* for the
    main function. C++ does not supply a default type.

    main() // wrong

    int main() // right

    - Wayne
    Monday, July 04, 2011 3:40 PM