• 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: error: array bound is not an integer constant
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error: array bound is not an integer constant


  • Subject: Re: error: array bound is not an integer constant
  • From: Tim Conkling <email@hidden>
  • Date: Fri, 15 Jul 2005 13:53:34 -0400

Why not use const variables instead?

Tim

On Jul 15, 2005, at 4:29 AM, Markian Hlynka wrote:

Hi all.

I've written some sample code below. This worked fine before, but I just upgraded to xcode 2.1 and tiger 10.4.2. Now it's broken. I need to be able to do this or else way lots of stuff breaks. Can someone help me find a solution, or understand what's going on? The problem seems to be in the typedef line. I don't actually need to do it for an int, but the error is the same. What's going on?


(and yes, for all sorts of reasons, I _do need to use preprocessor defines for now)



Thanks,

Markian


----------------------------------------- #include <iostream>

using namespace std;

#define part1 100

#define part2 50

#define combined (part1 * part2)


#define BOARD_SIZE 7 #define FBS (float)(BOARD_SIZE) #define MOVESFACTOR ((float)( ((int)( ( (FBS/2.0) * FBS) +0.5))+12.0)) #define MOVESFACTOR2 ((int)( (MOVESFACTOR/2.0)+0.5) ) #define MAX_LEGAL_MOVES (MOVESFACTOR2 * MOVESFACTOR2)

typedef int Movelist[MAX_LEGAL_MOVES];


int main() {


cout<<"done: "<<combined<<endl; } _______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: error: array bound is not an integer constant
      • From: Markian Hlynka <email@hidden>
References: 
 >error: array bound is not an integer constant (From: Markian Hlynka <email@hidden>)

  • Prev by Date: Re: Testing a framework using SenTestingKit and the debugger
  • Next by Date: Re: error: array bound is not an integer constant
  • Previous by thread: Re: error: array bound is not an integer constant
  • Next by thread: Re: error: array bound is not an integer constant
  • Index(es):
    • Date
    • Thread