/
Why do we need header files?

Why do we need header files?

The #include directive in C is used to insert the contents of one file into another before the program is compiled, often used for adding header files with function and variable declarations.

C/C++ compilers need to know the definition of a function etc. before you can use it in the code since C/C++ are strongly typed languages. In dynamic language you don’t need this.

It’s important that we pre-declare our types.

 

Related content

Make Dependency Files for C/C++ Headers
Make Dependency Files for C/C++ Headers
More like this
C Preprocessor
C Preprocessor
More like this
How can we make our code compile fast?
How can we make our code compile fast?
More like this
Dependency Tree
Dependency Tree
Read with this
What problem is created if a header file is included twice?
What problem is created if a header file is included twice?
More like this
How do you see how the pre-processor processes code?
How do you see how the pre-processor processes code?
Read with this