Yes you can make your own headers in c and c++.
very simple way …
(In windows OS)
you need a c/c++ compiler to test it.
Now open turbo c++.
2.Now type functions in it.
//header file no. 1
int add(int a,int b) //function 1
int sub(int a,int b) //function no. 2
//add ur own functions…
Give name as Myheader.h
and save(I will recommend that save in Turboc3\include\).
note: You must know where the file is stored.by default it will be in bin folder.while saving note down address.
and don’t get confuse in address….
#include<MyHeader.h>/*if u stored in include folder otherwise give path of file.*/
In linux there is easy way through shell:
Now follow these commands.
1.You will need root privilages to embed your header into system.(There is way without root also)
So type in shell
enter the passward if asked.if you dont know password goto step2.
2.Now in Home make directory
3.Now create file(you can use editors like gedit here I’ve used cat command):
int add(int a,int b)
(^z means ctrl+z which is used to terminate command in this case cat command)
4.Now check your header files for errors just by watching it again
5.[root]Now this step isfor root users to embed file in system.
“cp ./sampleHeader /usr/include”
(You can use “mv .. …” too)
6.[root]Check the header file if successfully copied or not
“ls /usr/include/sample*”(it will list files starting with sample)
Now you are ready.
7.Type c code and include this header files
[for root user who copied header in /usr/include do like this]
You have to give complete path.
dont copy above path.First check your file’s path by checking its properties and theninclude that file.
any error occured check steps correctly.