Re: [C++] Functions Opinion
From: 4-LOM (ngroups_at_4-lom.com)
Date: 01/09/04
- Next message: osmium: "Re: How to refresh another dialog box"
- Previous message: Robert W Hand: "Re: [C++] Casting void* pointers within different scope"
- In reply to: jeffc: "Re: [C++] Functions Opinion"
- Next in thread: jeffc: "Re: [C++] Functions Opinion"
- Reply: jeffc: "Re: [C++] Functions Opinion"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 9 Jan 2004 04:27:02 -0800
> That would be fine, Certainly prototyping is not frowend upon, but keep in
> mind that your case is limited to small programs. It's unusual in a
> professional environment to work on programs where everything is in the same
> file with "main". So prototypes become far more important when you have
> include files full of prototypes, or other declarations.
I've found that even with trivial programs which only have one source
file, putting all the function definitions before main can be a pain,
because if one function needs to call another you have to make sure
the function being called has been declared before you define the
function which can call it. If there are lots of ways in which
functions can call each other you might find that there is no way you
can order the definitions without getting compile time erros, so
prototyping becomes unavoidable. That might just be a case of bad
design though, and in any case I've moved onto using multiple source
files and header files.
- Next message: osmium: "Re: How to refresh another dialog box"
- Previous message: Robert W Hand: "Re: [C++] Casting void* pointers within different scope"
- In reply to: jeffc: "Re: [C++] Functions Opinion"
- Next in thread: jeffc: "Re: [C++] Functions Opinion"
- Reply: jeffc: "Re: [C++] Functions Opinion"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]