Tutorial references

c
c++
c#

Tutorial references

chapters

Create Header (.h) Files in C

Step-1

first type your code. It means create a function.

Example

int sum(int a, int b){
return a + b;
}


Step-2

Now compile above code.

If code is error free and no any warning then follow the step-3.

Step-3

Now save code with ".h" extension.

Example: sabbla.h

save ".h" file in "include" folder of compiler in C drive.

NOTE:- Do not give pre-compiled header file name. Like "stdio.h".

Step-4

Now include your self created header file in your program.

Syntax:

#include<filename.h>

OR

#include"filename.h"

In below program "sum()" function is defined in your self created header file. like "sabbla.h".

If you have not included self created header file(sabbla.h) and you have called sum() function in your program then your program will give error otherwise program can not give error.

Example

#include <stdio.h>
#include <sabbla.h>
#include <conio.h>

void main(){
 int s;
 clrscr();
 s = sum(100,200);
 printf("\nsum = %d",s);
 getch();
}

Run program

About Us

This website(www.sabbla.com) is very useful for beginners and professional developers. Sabbla provides tutorial in simple language. It provides latest technology tutorial which very useful for developers.

See More...

Contact Us

+91 9971366710

+91 9717983128

info@sabbla.com

Buxar, Bihar, India, Pin No.- 802131

Services

Sabbla is providing free latest technology tutorials. All tutorials are free for beginner and professionals.


Terms of Use

sabbla.com is not responsible for any mistake. Users can inform to sabbla.com for any mistake. But sabbla.com always try for 0-0 mistake.

Privacy policy

Currently sabbla.com does not collect any data from users.

                   

copyright © 2017-2018