11th Computer Science 12th Computer Science BCA CBSE CBSE JAC JAC

How to create own Header File in C++ with example

Written by AIPS

In this topic we are going to learn How to create own header file in c++ in very easy steps.

As we know that Header file is a file that contains the definition of functions or methods.

It has extension .h by default.

If we write header files in a program then their respective functions can be used.

If we use any function and respective header file related with that function not included in program then compiler generates prototype error.

There are various header files in C++ which contains functions definition .

for example

#include<iostream.h>

contains the method related to input output like cin, cout…..

#include<conio.h>

contains the method related to console input output like clsrscr(), getch(), etc..

#include<math.h>

contains the method related to mathematics like sqrt( ), pow(), etc…

About the author

AIPS

Leave a Comment