Alan Balmer <> writes:
[...]
> Normally, you would put the main() in a file which has a name
> appropriate for your program. For example, if your program is going to
> be called widget, put the main in widget.c.
>
> Consider - if I always put main() in a file named main.c, after 20
> years of C programming, I would now have a thousand files named
> main.c! How would I remember which was which?
Presumably you wouldn't have to remember; you could tell by the name
of the directory it's in. (This assumes a programming environment
that keeps source files in directories, of course.)
I'm not saying you *should* call it main.c, only suggesting that doing
so doesn't necessarily mean you should be laughed at.
I consider either "widget.c" or "main.c" to be a reasonable name for
the source file containing the main program for "widget". The name
"main.c" could cause problems if a single project has multiple main
programs, but you can always put them in separate subdirectories.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.