I really do not get the relationship between .c files and .h files. If i call .h files from a program(modelica), does this .h file call .c files directly? Or how is it work? Thanks.
Asked
Active
Viewed 32 times
0
-
It clearly explains here the .h file http://stackoverflow.com/questions/1945846/c-what-should-go-into-an-h-file – May 22 '14 at 09:52
-
See [this answer](http://stackoverflow.com/q/6264249/1362568). Applies equally to C and C++. – Mike Kinghan May 22 '14 at 11:08
1 Answers
0
There is no such thing as "calling a .c (or .h) file" - your code will allways call the object code in the compiled files. The header file (.h) will provide you with a prototype of what is in there, so you can use functions in a precompiled library by just referencing the .h file with an #include
.
This allows you to have a single shared binary (.so, .dll, .dylib, ...) and use the header files to link to them.

Eugen Rieck
- 64,175
- 10
- 70
- 92