Practice # 5
Header File which files that tell the compiler how to call any functionality (even without knowing that how it functionality actually works) so that is called Header file. The header file consist on function prototypes and they also consist of constants and data types used with libraries.
Now the question is why we use user define header file except the system header file?
The purpose of the user-defined header file in C++ is that in the C++ language there aren't module imports or anything similar that exist in other languages. This is the only way for the compiler to know about types, functions, etc from other files is to paste the code into the current source file by using #include.
Header File which files that tell the compiler how to call any functionality (even without knowing that how it functionality actually works) so that is called Header file. The header file consist on function prototypes and they also consist of constants and data types used with libraries.
Now the question is why we use user define header file except the system header file?
The purpose of the user-defined header file in C++ is that in the C++ language there aren't module imports or anything similar that exist in other languages. This is the only way for the compiler to know about types, functions, etc from other files is to paste the code into the current source file by using #include.
#include <iostream>
#include "New.h"
// There are two types of header files
// 1. System header files: It comes with the compiler.
// 2. User defined header files: It is written by the programmer.
/*
1. System header files like this
'#include <iostream>'
2. User defined header files like this
'#include "New.h"'. if you want to make your own header file,
you should be create a file in your current directory. If you
don't create it will shows an error.
*/
using namespace std;
int main()
{
cout<<"This is the Header files lesson program";
return 0;
}
Comments
Post a Comment