• 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: Is This Right?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is This Right?


  • Subject: Re: Is This Right?
  • From: "Don Arbow" <email@hidden>
  • Date: Tue, 5 Jun 2001 13:10:01 -0700

> Do I understand this right? Can these two lines of code:

> NSMutableArray *myArray;
> myArray = [[NSMutableArray alloc] init];

> be combined thus:

> NSMutableArray *myArray = [[NSMutableArray alloc] init];


Sure, the C language allows you to combine a variable declaration with an
initializer. The above is just as valid as this:

int myVar = 5;

But make sure that all of your declarations are at the top of the function.

Don


  • Follow-Ups:
    • Re: Is This Right?
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Re: Is This Right?
  • Next by Date: Re: My Newbie Learning Question
  • Previous by thread: Re: Is This Right?
  • Next by thread: Re: Is This Right?
  • Index(es):
    • Date
    • Thread