Results 1 to 2 of 2

Thread: what is the use of header file apart from preventing recompilation

  1. #1
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default what is the use of header file apart from preventing recompilation

    hi
    Is there any use of header file apart from prevention recompilation and hiding the implementation.

  2. #2
    Join Date
    Jul 2008
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: what is the use of header file apart from preventing recompilation

    Your header files are not for preventing recompilation (especially since modifying a header requires all including compilation units to be recompiled), nor do they hide things - it's all the contrary, actually. They expose the interface of other compilation units or libraries so that the compiler knows what symbols are available.

    Say you want to use printf. Unless it is declared in a header file, the compiler has no way to know what arguments it takes or what it returns. Same thing for global variables. This is what header files are mainly for.

    http://en.wikipedia.org/wiki/Header_file

Similar Threads

  1. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  2. AVOIDING mutiple inclusion of header file???
    By pratik in forum General Programming
    Replies: 4
    Last Post: 10th July 2007, 14:09
  3. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  4. Related to header file
    By merry in forum Qt Programming
    Replies: 2
    Last Post: 10th May 2007, 13:03
  5. qt3 to qt4 - uic issue
    By hvengel in forum Qt Programming
    Replies: 10
    Last Post: 4th March 2007, 02:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.