Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

what is header files in embedded c programming

Status
Not open for further replies.

bbgil

Full Member level 2
Joined
Mar 11, 2006
Messages
135
Helped
13
Reputation
26
Reaction score
9
Trophy points
1,298
Activity points
2,321
hi. i'm learning embedded c, and i came across this header files in one of the example project of MikroC, Display1_utils.h . i try not to use it but i didn't work. What is the purpose header files? i check the header and it only contain a single line. Any explanation here is appreciated. thnx in advance.
 

hi,

a little explenation:

https://en.wikipedia.org/wiki/Header_file

in short, ehader file is very useful to make modular development, where the applicaiton is divided in to many source codes modules

regards,
 

    bbgil

    Points: 2
    Helpful Answer Positive Rating
It is easier to manage code if you split a program into files. It also promotes reusable code. For instance, you can write a file that just deals with PWM functions, one that just deals with A/D functions, one with just timer functions etc. The header file exposes only the function prototypes that are called from the main thread, so the linker may find them.
Declaring a function static in a file limits it's scope to that file.
Taking it further, the code in the file can be optimised and fully debugged, you can then compile it to a library. In future projects, you can include the header file and the linker will only link in the functions you call. So you get rapid application development with known good working code.
 

    bbgil

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top