• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Learning to program Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Learning to program Cocoa (From: Finlay Dobbie <email@hidden>)

  • Prev by Date: [ANN] InstallAnywhere 4.5 Developer Preview
  • Next by Date: Re: NSTableView Selection and Flicking
  • Previous by thread: Re: Learning to program Cocoa
  • Next by thread: Multiple NIBs and -awakeFromNib problems
  • Index(es):
    • Date
    • Thread