'main.h' is called a header file. It is like all other header files - basically it includes the code it contains into the code that calls the include directive. I wrote the function in an include file because it makes programs more readable and also you can include that code in another program. You could just not write an include file and instead copy what I wrote in the include(main.h) into the source code (main.c) at the point where I wrote the include directive (#include "main.h", and if you do this delete the include directive as that "main.h" file is not needed.
I suggest you start using include files, but if you are not comfortable with them yet just do what I said above. Adam
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.