Difference between library file and header file?

1 answer

Answer

1269149

2026-05-06 08:50

+ Follow

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

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.