include files

This is a discussion on include files within the C++ Programming forums, part of the General Programming Boards category; heya, i have a c++ header in *.h format. I have put #include <iostream.h> #include <fareylist.h> but am given the ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    35

    include files

    heya,

    i have a c++ header in *.h format. I have put

    #include <iostream.h>
    #include <fareylist.h>

    but am given the error: unable to open include (referring to fareylist.h>

    i am running the borland turbo c++ compiler.

    My question is what is the difference between #include <iostream.h> and plain #include <iostream>

    is it legal to write #include "iostream.h"?

    and what could be the causing my error with the unable to open include?

    The files are all saved in the same directory so i presumed it should be in my path, but im not sure.

    tia

  2. #2
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    <iostream.h> is the old header and is no longer fully supported by most modern compilers, but <istream> follows the new standards...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    35
    thanks for your reply.

    what about the fareyList.h which is causing the error? is it path related although their all in the same folder?

    is the #include "fareyList.h" legal? if so is it equivalent to #include <fareyList.h>?

    cheers

  4. #4
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,789
    If the header file is in the same folder/directory as the source that you are compiling, then you should be using #include "fareyList.h". You use <> when you reference header files that come with your compiler, ones that are located in a specific folder when you installed your compiler. By trying to do it that way, you are telling the compiler to look for your header file in the wrong location. It can't find it in that location so it spits out that "unable to open" line. The two are not equivalent.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    35
    fantastic reply. thanks, answered exactly what i was after.

    -twans

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. debug assertion failed!
    By chintugavali in forum C Programming
    Replies: 4
    Last Post: 12-11-2007, 05:23 AM
  2. Header file include order
    By cunnus88 in forum C++ Programming
    Replies: 6
    Last Post: 05-17-2006, 03:22 PM
  3. include files that are'nt in compiler's directory
    By vaibhav in forum C++ Programming
    Replies: 10
    Last Post: 03-25-2006, 10:45 AM
  4. Include files
    By disruptivetech in forum C++ Programming
    Replies: 7
    Last Post: 07-12-2005, 09:52 AM
  5. include library header in header files
    By Raison in forum C++ Programming
    Replies: 6
    Last Post: 09-27-2004, 02:50 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21