Electronic Mail
Message #7569860
Date: Tuesday, February 03, 1998   8:27:36 AM
From: IN:perry@moe.acad.humberc.on.ca
To: GRDJ0002
Topic: <none>

<<< This message is part 2 of a previous message >>>

pre-compile stage. In this case it tells the compiler to add the named file to
your source file "at this point".  It has no further effect and is removed by
the compiler once this is done.  In short, it saves you repeatedly typing the
contents of the included file over-and- over in several programs.  You could,
if you wish print STDIO.H and copy-type it into every programs that needs
the standard library I/O functions ... that is you could copy-type ALL 300
LINES of STDIO.H (or you could #include <stdio.h>).  You choose!

You should NOT put the .H files in the project file BECAUSE THEY ARE
ALREADY A PART OF YOUR PROGRAM ... you #include'd them! 
BESIDES, if you put an .H file in your project then it will be compiled
separately as if it were a .C or C++ file. If you do you will get some very
strange error messages as noted above.   The .H file should contain no
imperative code ... therefore there should be no need to compile it
separately.  The compiler is NOT expecting the kind of stuff normally in a
.H file to be compiled by itself ... hence the incomprehensible error
messages.

You need appropriate #include files in every source file which uses a
standard library function,   The fact that you have the same #include file in
another source file is IRRELEVANT because source files are compiled one-
at-a-time.  The question is only ... am I calling a standard library function
from ANYWHERE in this source file?  If the answer is YES then you need
one or more appropriate #include statements.



Brian Perry


