The Ultimate Qt Community site
Home News Forum Wiki Contest FAQ Links

Go Back   Qt Centre Forum > Other > General Programming

General Programming Forum devoted to general, non-Qt programming issues.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 4th July 2008, 09:12
babu198649 babu198649 is offline
Intermediate user
 
Join Date: Nov 2007
Posts: 216
Thanks: 59
Thanked 0 Times in 0 Posts
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.

Reply With Quote
  #2  
Old 4th July 2008, 14:24
Gnurou Gnurou is offline
Beginner
 
Join Date: Jul 2008
Qt products used: Qt4
Qt platforms used: Unix/X11
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
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

Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 05:59.

Powered by vBulletin Version 3.7.1 Copyright ©2000 - 2008, Jelsoft Enterprises Ltd., vRewrite 1.5 SEOed URLs completed by Tech Help Forum and Chalo Na.
© 2006–2008 Qt Centre - The Ultimate Qt Community site
Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.