Re: Const help
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
References: | |
| >Const help (From: Killobit <email@hidden>) |