- #1
CGandC
- 326
- 34
In the C programming language any
But if I write for example,
So I haven't really understood, If
Thanks in advance for any help!
.h
file is a file that contains constants and/or function declarations ( but no implementations, besides inline functions ). That means that when I write #include <foo.h>
at the start of my .c
file, I'll have to implement all those function declarations ( similar to implementing an interface in Java ). But if I write for example,
#include <stdio.h>
at the beginning of the code, then I read that by doing this I am now able to call input/output related functions such as printf()
; I don't know how calling these functions is possible right now because I understood that after adding #include <stdio.h>
to the beginning of the code then I have only added function declarations from stdio.h
into my .c
file and not yet implemented these declarations ( haven't defined them yet ) - this means that I have to implement those functions in my .c
code ; however, a .c
file compiles without implementing printf()
for example.So I haven't really understood, If
#include <foo.h>
just copies the contents of the declarations in foo.h
file - function declarations which I have to implement in the .c
file, then why when including #include <stdio.h>
In my .c
file don't have to implement functions declared in that header such as printf()
?Thanks in advance for any help!