Thread: When to create a header file?

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    66

    When to create a header file?

    When would you create a header file?

    Im guessing its for storing functions you would use in more than 1 program?

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    It's for storing prototypes of functions and defining types and variables but they could also contain functions.
    You can place anyanywhere. If it's something you'll use a lot then you could place it in your compilers include directory but they are usually placed in the same place as your source code.

  3. #3
    Registered User
    Join Date
    Mar 2005
    Posts
    37

    Lightbulb header files..

    according to me. more than header file.. i would call it include file. .. I usally do modular programing.. so I divide my problem into small chunks .. write separate code of it. check if it complies properly.. and finally include in my main program.

    Yes what you said is also right if i want a perticular chunk of code in more than one program i would do the same.. !!

    cheers.. hackernet

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  2. Class methods in header or source file?
    By TriKri in forum C++ Programming
    Replies: 13
    Last Post: 09-17-2007, 05:23 AM
  3. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM