header file in c++

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Xohaib

    header file in c++

    hey guys i wnat to make a my own header file like i want that i make a
    header file exmple.h and i want that when i use exmple.h i should not
    need to include iostream.h and one other header files like this. So
    how can i make it in VC++ (IDE). I shall b very thankfull to you.......

  • Han

    #2
    Re: header file in c++

    On 11 10 , 6 22 , Xohaib <zohaib.shir... @gmail.comwrote :
    hey guys i wnat to make a my own header file like i want that i make a
    header file exmple.h and i want that when i use exmple.h i should not
    need to include iostream.h and one other header files like this. So
    how can i make it in VC++ (IDE). I shall b very thankfull to you.......
    I think you can include the head file you want in the head file you
    make by yourself....
    or maybe your question is not so simple?

    Comment

    • Jim Langston

      #3
      Re: header file in c++

      "Han" <Mingwei.Han@gm ail.comwrote in message
      news:1194700086 .797614.225710@ i13g2000prf.goo glegroups.com.. .
      On 11 10 , 6 22 , Xohaib <zohaib.shir... @gmail.comwrote :
      >hey guys i wnat to make a my own header file like i want that i make a
      >header file exmple.h and i want that when i use exmple.h i should not
      >need to include iostream.h and one other header files like this. So
      >how can i make it in VC++ (IDE). I shall b very thankfull to you.......
      >
      I think you can include the head file you want in the head file you
      make by yourself....
      or maybe your question is not so simple?
      Also, I'd like to point out that the header file is <iostreamnot
      <iostream.h iostream.h is a pre-standard header.
      And, like Han says, just include the headers in your header. Headers should
      always include headers that they need to compile.


      Comment

      • =?UTF-8?B?RXJpayBXaWtzdHLDtm0=?=

        #4
        Re: header file in c++

        On 2007-11-10 14:19, Jim Langston wrote:
        "Han" <Mingwei.Han@gm ail.comwrote in message
        news:1194700086 .797614.225710@ i13g2000prf.goo glegroups.com.. .
        >On 11 10 , 6 22 , Xohaib <zohaib.shir... @gmail.comwrote :
        >>hey guys i wnat to make a my own header file like i want that i make a
        >>header file exmple.h and i want that when i use exmple.h i should not
        >>need to include iostream.h and one other header files like this. So
        >>how can i make it in VC++ (IDE). I shall b very thankfull to you.......
        >>
        >I think you can include the head file you want in the head file you
        >make by yourself....
        >or maybe your question is not so simple?
        >
        Also, I'd like to point out that the header file is <iostreamnot
        <iostream.h iostream.h is a pre-standard header.
        And, like Han says, just include the headers in your header. Headers should
        always include headers that they need to compile.
        A tip I read in here recently: often you can get away with just
        including <iosfwdin the header-file and include stuff like <iostream>,
        <fstream>, etc. in the .cpp-file. I think that can speed up the
        compilation a bit but I do not have any projects of size to test on at
        the moment.

        --
        Erik Wikström

        Comment

        Working...