answersLogoWhite

0


Best Answer

A header file is normally used for declarations to provide an interface that can be included into a source file that wants to use the functions/variables that have been declared. If the header file contains function prototypes, it will usually have a corresponding source file that defines the functions.

/* example.h */ #define bTRUE 1 #define bFALSE 0 typedef int BOOL BOOL bEvenNumber(unsigned int uiNumber); /* example.c */ #include "example.h" BOOL bEvenNumber( unsigned int uiNumber) { return (uiNumber & 1) ? bFALSE : bTRUE; }
User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

A header file contains declaration of something (constants, classes, ...), usually ends with a .h or hpp extension.

A DLL (dynamically linked library) is a binary file (with .dll, .ocx, .a, ... extentions), containing functions, resources, ... and can be linked to your program at run-time. In order to use a DLL you need to include the corresponding header file, which declares things in the DLL, so that your program gets compiled. The DLL file is automatically loaded (by system) at run-time when your executable program invokes functions and asks for resources.

A library file (also called static library, with .lib extension usually) is a binary file which also contains functions and variables like DLL, but resolved at compile-time, meaning they need to be provided at link-time.

Dynamic and static libraries are often provided together with header file (but no source file, which contains the implementation) when the provider lets you use his/her functions/services but doesn't give you access to the implementation.

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

Header file contains only the declaration of the function being used. While, the library file has the files of the declared function in the header file.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference between header file and library file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between program and programing?

the program contains the which are coding like as our header file ,void main,library function etc.


What is the difference between using angular brackets in C language and double quotes in Cpp language to enclose header files?

When you includes any header file using "" that time compiler try to locate this file first from your program's local directory and then from library. But if you include the .h file using <> then compiler assumes you are including some library file.


How do you find out the name of a library file of its corresponding header file?

i can't answer it


What is the header file for string library function?

string.h


Difference between library file and header file?

EX: pgm #include<stdio.h> main() { printf("haiii"); } Header file: (1) contains the function(printf) declaration (2) during preprocessing, the printf function is replaced by the function declaration Library file : (1) contains the function(printf) definition (2) during linking, the function declaration is replaced with the function definition.obviously, everything will be in object while linking


Is header file the library file?

No. Header files are those which contains declaration part of function & library files are those which contains definition part of function. These are those functions which we called in our program by using header files.


What is the difference between the header file and the preprocessor directive in programming language cpp?

pata nhn


What is the different between header file and header pointer?

Header file is a file which is meant to be included into another file during compilation. Examples: string.h, stdio.h, inttypes.h. Header pointer is a pointer to an object called header (for example header of a linked list).


How is a library file incorporated in a C program?

Every library requires a header file (.h file) that can be included in any translation unit that requires access to the library. The header describes the library interface. The library implementation may be provided by a corresponding .c source file in which case you can compile the library into your program just as you would any other translation unit. However, most library implementations are provided by a precompiled library file (.lib file) and you generally won't have access to the source file. The precompiled library file is required by the linker while the corresponding header is required by the compiler.


What is the importance of header file?

A header file is a library of a no. of functions, which could be used (once or more than once) in some or the other programs. Thus, instead of defining all functions separately we can assemble them in a single library, the header file. These can be predefined or user defined. Hence, it reduces the line of codes and also the complexity.


How can i add the Dhcpsapi library in code blocks IDE?

Link your project to the dhcpsapi.lib library file and include the dhcpsapi.h header file in all translation units that make use of the library.


What is a header file and library function?

header files are predefined in c, they include the all necessary function to u to do your work easy instead of writing a function for printing a message or to read a input form key board we are using the library functions which are in the header files. there are different types of header files depending upon the requirement we use them.