Path: utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!agate!apple!bridge2!csi!nsc!pyramid!leadsv!laic!nova!darin
From: darin@nova.laic.uucp (Darin Johnson)
Newsgroups: comp.lang.c
Subject: Re: want to know
Message-ID: <664@laic.UUCP>
Date: 10 Aug 89 23:32:58 GMT
References: <8487@bsu-cs.bsu.edu> <2980@solo9.cs.vu.nl> <182@sunquest.UUCP>
Sender: news@laic.UUCP
Reply-To: darin@nova.UUCP (Darin Johnson)
Organization: Lockheed AI Center, Menlo Park
Lines: 20

In article <2980@solo9.cs.vu.nl>, roemer@cs.vu.nl (Roemer Lievaart) writes:
> 
> Hi, everybody,
> 
> I'm also a University's student in need of help. I always see that people
> define the function 'main' in C-programs. Why is that? What should it return?
> Can't I use another name?

It is a UNIX-ism.  The UNIX linker uses that function name as the name of
the first routine to jump to (although many UNIX version may have ways
around this).  Other operating systems and linkers do things differently
(first function found, special symbol in the object file, specified on
command line, etc.).  However, most C compilers use main() as the
default (with a way out if you need to), since that is what K&R uses.

Also, for you confusion, most UNIX kernels do not start at main() or even
have a main()...

Darin Johnson (leadsv!laic!darin@pyramid.pyramid.com)
	We now return you to your regularly scheduled program.