[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
RE: [LI] C Programming problem
- To: "linux-india@xxxxxxxxxxxxxxxxxxxxx" <linux-india@xxxxxxxxxxxxxxxxxxxxx> (Non Receipt Notification Requested) (IPM Return Requested), Rohit <rohits@xxxxxxxxxxxxxx> (Non Receipt Notification Requested) (IPM Return Requested)
- Subject: RE: [LI] C Programming problem
- From: LENGARD Pascal OCISI <pascal.lengard@xxxxxxxxxxxxxxxx>
- Date: Thu, 4 Nov 1999 13:07:03 +0100
- Alternate-recipient: Allowed
- Discarded-x400-ipms-extensions: iso (1) (3) (6) (1) (7) internet.7 (1) internet.7.1 (1) internet.7.1.1 (3)
- Incomplete-copy:
- Original-encoded-information-types: ia5-text,undefined
- Reply-to: linux-india
- Sender: owner-linux-india@xxxxxxxxxxxxxxxxxxxxx
- X400-content-type: P2-1988 (22)
- X400-mts-identifier: [/PRMD=francetelecom/ADMD=atlas/C=fr/;028DA382176E7021-mtaFT2]
- X400-originator: pascal.lengard@francetelecom.fr
- X400-received: by /PRMD=INTERNET/ADMD=ATLAS/C=FR/; Relayed; Thu, 4 Nov 1999 13:10:09 +0100
- X400-received: by mta xr4-gw.atlas.fr in /PRMD=INTERNET/ADMD=ATLAS/C=FR/; Relayed; Thu, 4 Nov 1999 13:10:09 +0100
- X400-received: by /ADMD=ATLAS/C=FR/; Relayed; Thu, 4 Nov 1999 13:10:05 +0100
- X400-received: by /PRMD=francetelecom/ADMD=atlas/C=fr/; Relayed Redirected; Thu, 4 Nov 1999 13:07:03 +0100
- X400-recipients: non-disclosure:;
>
> > 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.