Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the include in the middle of code in C?

Tags:

c

include

Please, could you tell me what does the code below do?

...code...
#include file.h
...code...

I was used to put includes a the beggining of each file. I have never seen this before and also wasn't able to find anything in the internet.

like image 935
Martin Plávek Avatar asked Jan 09 '23 07:01

Martin Plávek


1 Answers

#include is a pre-processor directive that takes the file given as the argument and dumps its contents in the current file. Typically, this is used to include definitions of commons functions from header files, but there's no necessity to use it in that way.

like image 103
Mureinik Avatar answered Jan 18 '23 07:01

Mureinik