🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #1187

Re: Pascal program works but not C program!

#1187
From: The MadMan
Date: Sun, 21 Jan 1996 13:23
29 lines
1525 bytes
In <4dmpv0$t77@fangz.com> shad@fangz.com (Shadow.King) writes: 
>
>: > 
>: > void main(int argc,char *argv[])
>:    ^-----------------------------This one too, but not too serious
>: > {
>: > }
>: > 
>: > 
>
>This isn't really a problem, it's usually just the error code that the

>program returns to dos when it exits. As far as I know it doesn't HAVE
to 
>do this so just void main should be fine, I usually do the same thing 
>with simple programs that don't need to set the error level on exit
and 
>I've had no problems whatsoever with it. It is if the program is
supposed 
>to return an error level though.

Wait a minute... void main() is NOT correct.  The startup code calls
exit_code = main() and expects a value to be returned to it (it is the
same as one of your routines being called by -   value = function()  
and the function being defined -   void function()   that doesn't
mesh).  Use the C lamguage correcly and it won't bite with little
errors like this.

Later, Jon
Technical Details
Message-ID: <4dtenn$ik9@cloner2.ix.netcom.com>
Path: arc1-ca.pugleaf.net!ix.netcom.com!netnews
References: <4cdpr2$psi@lugb.latrobe.edu.au> <Pine.SV4.3.91-heb-2.04.960104114930.16292A-100000@cs.technion.ac.il> <4dmpv0$t77@fangz.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!ix.netcom.com!netnews
From: jmanson@ix.netcom.com(The MadMan )
Newsgroups: alt.msdos.programmer,comp.lang.c
Subject: Re: Pascal program works but not C program!
Date: 21 Jan 1996 13:23:03 GMT
Organization: Netcom
Message-ID: <4dtenn$ik9@cloner2.ix.netcom.com>
References: <4cdpr2$psi@lugb.latrobe.edu.au>  <Pine.SV4.3.91-heb-2.04.960104114930.16292A-100000@cs.technion.ac.il> <4dmpv0$t77@fangz.com>
NNTP-Posting-Host: sdx-ca8-21.ix.netcom.com
X-NETCOM-Date: Sun Jan 21  5:23:03 AM PST 1996