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 in case of a library.
There certainly is. If your application is spread across multiple source files, and most non-homework/assignment ones are, then they allow you to use the same classes, prototypes and definitions in all of them. By including the header file in the source files that need access to its contents, you can have a single definition that, if it needs changing, only needs to be changed in one place in one file. That way the change is automatically propagated throughout your whole project.
Topic archived. No new replies allowed.