| delorie.com/archives/browse.cgi | search | 
| From: | "regis.dupuy" <regis DOT dupuy AT wanadoo DOT fr> | 
| Newsgroups: | comp.os.msdos.djgpp | 
| Subject: | Re: building header files with rhide | 
| Date: | Tue, 7 Dec 1999 13:34:03 +0100 | 
| Organization: | Wanadoo, l'internet avec France Telecom | 
| Lines: | 76 | 
| Message-ID: | <82iunj$p2a$1@wanadoo.fr> | 
| References: | <82gi60$pqd$1 AT wanadoo DOT fr> <384C53B5 DOT 165259C4 AT id-base DOT com> | 
| NNTP-Posting-Host: | poitiers-9-234.abo.wanadoo.fr | 
| X-Trace: | wanadoo.fr 944569907 25674 164.138.146.234 (7 Dec 1999 12:31:47 GMT) | 
| X-Complaints-To: | abuse AT wanadoo DOT fr | 
| NNTP-Posting-Date: | 7 Dec 1999 12:31:47 GMT | 
| X-Newsreader: | Microsoft Outlook Express 4.72.3110.5 | 
| X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3 | 
| To: | djgpp AT delorie DOT com | 
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp | 
| Reply-To: | djgpp AT delorie DOT com | 
sephiroth AT id-base DOT com a écrit dans le message
<384C53B5 DOT 165259C4 AT id-base DOT com>...
>"regis.dupuy" wrote:
>
>> Hi
>> I program in c with rhide and I'm a beginner
>> how should I do to build my header files (name.h) to use functions I have
>> made in other programs without typing them again
>> I would be glad if someone could give me one example
>> (like making myfunc.h with a clear screen function in it or another one)
>> or show me a tutorial
>> regis DOT dupuy AT wanadoo DOT fr
>
>I'm not sure if this will answer your question, but here is how I create
>header files:
>
>Put all the relevant functions into one file which has a .c or .cpp
>extension. The File should go something like the following. For our
purposes,
>we shall call the file, myfunc.c
>
>#include "myfunc.h"
>
>short
>my_function( short sCalc )
>{
>  sCalc += 22;
>}
>
>long
>my_function2( long lCalc )
>{
>  lCalc += 22;
>}
>
this file don't compile. the compiler doesn't know where is myfunc.h
thanks to help me
>
>This is basically where our functions definitions are held. You then want
to
>make a header file for myfunc.c called myfunc.h to indicate a header file.
>Here is the example of this:
>
>/*These 2 preprocessors are there to stop the compiler including the file
>more than once: */
>#ifndef __MYFUNC_H__
>#define __MYFUNC_H__
>
>/*Include all the Files needed by the functions first: */
>#include <stdio.h>
>
>/*Prototype the functions: */
>short my_function( short sCalc );
>long my_function2( long lCalc );
>
>
>/*Include the myfunc.c file to show where the functions are held: */
>#include "myfunc.c"
>
>#end if // __MYFUNC_H__
>
>
>In my opinion, the header file should follow this order. Some people may
and
>probably will disagree. hope this helps.
>
>--
>shinyblue             Current listening:
>---Blue Fish - One ---------------------
>---Paul Van Dyk - Another way/Avenue ---
>- http://members.dencity.com/blahblur  -
>
>
| webmaster | delorie software privacy | 
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |