Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to make header files in C ?

Status
Not open for further replies.

hesho13

Junior Member level 1
Joined
Dec 31, 2004
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
167
header files

hello guys ,..
can anybody please guide me how can i make a header file in c-language so as to include it when needed,..
i need a book or code examples,..
thanks a lot,...
 

amertarekt

Newbie level 2
Joined
Feb 28, 2006
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,300
Re: header files

i am amir tarek
student at engineering college of cairo university at computer department
to make header file:
press FILE then NEW then HEADER FILE it will be named as name.h
to write init make like this
ifndef NAME_H
def NAME_H
{

write the code here like classes or struct


}
when u use it in a program u must write #include"NAME.h" &include the file with ur project
 

swgchlry

Member level 4
Joined
Dec 8, 2003
Messages
70
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
718
header files

use any editor, create the following three files:
///test.h
#ifndef __TEST_H__
#define __TEST_H__

int proc(int arg1);

#end if

///test.c
#include <stdio.h>
#include "test.h"
int proc(int arg1){
printf("Hello world!\n");
return 1;
}

////youproject.c
#include "test.h"
void main(){
return proc(1);
}

I think you should buy a book, such as K&R's <<The C Programming Language>>
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top