Re: Learning to program Cocoa
Re: Learning to program Cocoa
- Subject: Re: Learning to program Cocoa
- From: Ondra Cada <email@hidden>
- Date: Tue, 28 Aug 2001 22:00:14 +0200
Finlay,
>
>>>>> Finlay Dobbie (FD) wrote at Tue, 28 Aug 2001 18:26:31 +0100:
FD> >exit(0); // _E_nsure the process exit status is 0
FD> >return 0; // ...and make main fit the ANSI spec.
FD>
FD> That's a bit redundant isn't it? exit with a return status of 0, and
FD> then exit with a return status of 0 (although the second one is never
FD> called)?
It's utterly redundant. Though, it is the code NeXT's (uh, sorry, Apple's)
templates contain and generate for a "new Tool project" (I've just corrected
the nonsensical "insure" there ;)
I would not write it that way myself; I can just guess that the original
writer of the code
(i) had a bitter experience with a C library which did not properly used the
main return value (ie. it was not used as the exit status);
(ii) did not like warnings;
(iii) probably due to C++ background did not like retyping main to void
(which is, actually, what I do in my own code ;)))
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc