DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: # include <iostream>

  1. #1
    Zada Guest

    # include <iostream>


    It's been quite a while since I've done any programming in C++, but I am now
    using VC++ and just tried to compile my first program in years and I got
    the error ...: fatal error C1083: Cannot open include file: 'iostream.h':
    No such file or directory...ok, I know this is silly, but what am I not doing,
    that it can't find the include file???

  2. #2
    jonnin Guest

    Re: # include <iostream>


    Er, try
    <iostream.h> or <iostream> not "" or ' ' if you did that.
    If not, you need to reinstall, did you mess with the default dirs?


    "Zada" <dale@DENBURY.COM> wrote:
    >
    >It's been quite a while since I've done any programming in C++, but I am

    now
    >using VC++ and just tried to compile my first program in years and I got
    >the error ...: fatal error C1083: Cannot open include file: 'iostream.h':
    >No such file or directory...ok, I know this is silly, but what am I not

    doing,
    >that it can't find the include file???



  3. #3
    ioslipstream Guest

    Re: # include <iostream>


    "Zada" <dale@DENBURY.COM> wrote:
    >
    >It's been quite a while since I've done any programming in C++, but I am

    now
    >using VC++ and just tried to compile my first program in years and I got
    >the error ...: fatal error C1083: Cannot open include file: 'iostream.h':
    >No such file or directory...ok, I know this is silly, but what am I not

    doing,
    >that it can't find the include file???


    There are two ways to do this, first I'll show you the old way:

    #include <iostream.h>




    That's the old way, here is the "new" way:

    #include <iostream>
    using namespace std;




    Both still work, but the second way is the one you should be using nowadays.
    If you typed in just #include <iostream> and didn't tell the compiler you
    were using namespace std, then you would get an error because it wouldn't
    be able to locate the header file. If you typed in #include <iostream.h>
    then you don't need to tell the compiler you are using namespace std, but
    you should get used to the second method listed because the first method
    is considered out of date, hope that makes sense for you.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center