From: | |
Date: | 20 Feb 2001 at 21:02:27 |
Subject: | Re: includes and stuff |
Hiya Joris,
On 20-Feb-01, you wrote:
> So i found out, i needed the string.h include to be able to use the strcat
> function, again i don't know what to do: put a #include <string.h> in this
> myfunctions.c file, or should it be in my myfunctions.h file...
Put them in the files where they are needed. Your .h should include any
typedefs (that need to be 'public') and the function declarations.
Your .c the code.
If string.h is only needed for strcat() then stick in the .c; again based
on your code the asl/exec side of things are only needed in the .c so put
the includes there.
If for example the exec part was needed for a type of parameter I would
include exec.h in both the .h and .c.
As for the library side of things. It's up to you; there is nothing
wrong with opening asl.library as you do; for something like asl.library or
openurl.library I personally think it is better to open it when needed.
However for something like utility.library I think it's better to open it
at the start.
> Thanks for any help and for all people who reacted to my IDCMP question.
The above is what I got out of my c++ book. or words to that effect
anyway. I have ben doing things this way for years and don't have any
problems.
Kind regards...
Alex
------------------------ Yahoo! Groups Sponsor ---------------------~-~>
eGroups is now Yahoo! Groups
Click here for more details
http://click.egroups.com/1/11231/0/_/451227/_/982699565/
---------------------------------------------------------------------_->