In: Computer Science
C++ Programming
Simply explain what the difference between "including" a header file and using a compiled library file during linking?
Where are the C++ header files and compiled C++ library files on your computer?
C++ including header files
There are two ways to include the header :
1. Library header files
Library header files are predefined files that contain the
definition of the functions.
For example, cmath header file that contains the basic mathematical
functions like
sqrt()
abs()
log10()
etc
To use those functions in the C++ program, we need to include the predefined header file cmath as #include<cmath>
So that we can call the functions in the program wherever it is required.
2.User-defined header files
User-defined files are user created header files that contain user
defined classes and methods.
To use user defined classes in the program, we need to include the
header file as
#include "file.h"
Where file.h is the header file name.
Now, we can call the functions inside the file.
----------------------------------------------------------------------------------------------------------------------------------------------
C++ header files and compiled C++ library files on your computer:
In Turbo C++, the pre-defined C++ library files are placed
in a
C:\CPP\INCLUDE