[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

RE: [LI] C Programming problem



>
> > As an aside, standard C demands that main should always return an
> > int. Your program might crash if you declare main as void main().
>
> Man, this I have observed as being used in countless programs on
> Tc++ [on PCs]
Anyway, the shell will always give you the return code of main()
with 'echo $?'
so a good practice is to define main as "int main(...)" and to end
main() by returning a correct value. If you do not, then you can not
tell what a particular system will do to correct this (dump core ?,
return a constant like 0, return a random value ?)

pascal  
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.