• 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: Const help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Const help


  • Subject: Re: Const help
  • From: AndrĂ©as Saudemont <email@hidden>
  • Date: Fri, 29 Oct 2004 16:34:21 +0200

Hi Eric,

On Fri, 29 Oct 2004 07:03:17 -0700, Killobit <email@hidden> wrote:

> I'm trying to create a constant that can be used in 2 different classes
> but the compiler keeps giving me the following error
>
> GokubanView.h:40: error: variable-size type declared outside of any
> function
>
> where the line is:
> int levelGrid[kGridSizeX][kGridSizeY];

Your issue is more related to Objective-C than to Cocoa.

kGridSizeX and kGridSizeY cannot be resolved at compile-time as
they're declared as "const int" values.

Define kGridSizeX and kGridSizeY as macros and everything should be fine:

#define kGridSizeX 19
#define kGridSizeY 16
...

Andréas

--
http://andreassaudemont.net/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Const help
      • From: Killobit <email@hidden>
References: 
 >Const help (From: Killobit <email@hidden>)

  • Prev by Date: Re: Framework and Prebinding
  • Next by Date: Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • Previous by thread: Const help
  • Next by thread: Re: Const help
  • Index(es):
    • Date
    • Thread