delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/09/16:39:04

From: Meta <syzmik AT concentric DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Newbie Header Question
Date: Wed, 02 Jul 1997 23:07:06 -0400
Organization: Concentric Internet Services
Lines: 32
Message-ID: <33BB175A.3A02@concentric.net>
References: <33b94c73 DOT 5843760 AT news DOT pangea DOT ca>
NNTP-Posting-Host: ts003d08.sag-mi.concentric.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

TDR wrote:
> 
> How can I make a header files for my source... I always get an error
> "don't know how to make blah.o from blah.h" I just want to have a
> multiple file project and I am using RHIDE...

This looks to be more of a C question than a DJGPP question, but here's
your answer, straight from the FAQ:

-----------------

10.6:	I'm splitting up a program into multiple source files for the
first time, and I'm wondering what to put in .c files and what to put in
.h files.  (What does ".h" mean, anyway?)

A:	As a general rule, you should put these things in header (.h) files:
            macro definitions (preprocessor #defines)
            structure, union, and enumeration declarations
            typedef declarations
            external function declarations (see also question 1.11)
  	    global variable declarations

   It's especially important to put a declaration or definition in a
header file when it will be shared between several other files.  (In
particular, never put external function prototypes in .c files.  See
also question 1.7.) On the other hand, when a definition or declaration
should remain private to one source file, it's fine to leave it there.
See also questions 1.7 and 10.7.

------------------------

Get the comp.lang.c FAQ list for more information

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019