Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 795

#include Header files in C with definition too [closed]

$
0
0

I'm like a 100% sure that this is a basic thing, and therefore I'm sorry if it has been answered.

I've seen many code samples and code bases where people include header files like this:

#include "util.h"int main(void){    int result = function1(); // something that was defined in util.h but implemented elsewhere    return 0;}

...while the content of the given header file is just:

#pragma onceint function1();int function2();float function3();

And probably there is a util.c somewhere that has:

#include "util.h"int function1(){    ...}int function2(){    ...}float function3(){    ...}

I have experience with the language.
I've used it in 1-2 larger projects (irc client).
I've used make files too, even though they were more like "script files".
But this header file thing... Can someone explain me this?


Viewing all articles
Browse latest Browse all 795

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>