• 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: #define issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #define issues


  • Subject: Re: #define issues
  • From: Justin Spahr-Summers <email@hidden>
  • Date: Sat, 16 Apr 2005 03:09:17 -0500

You can't access indices in an array with non-integer types. Cast the
doubles to ints before accessing the array.

On 4/16/05, Aaron Boothello <email@hidden> wrote:
> Hey guys,
> Thanks for your help on the dynamic arrays issue i was having.. managed to get it sorted out...
>
> Here's another issue i ran into. I should probably let you guys know that im porting some C++ code into a cocoa app.
>
> So the C++ code has dome definition and macros associated with them. the code looks like:
>
> typedef double matrix[16]
>
> #define setvalue(matrix, row, col, value) ( matrix[row+col] = value)  //roughly looks like this
> #define getvalue(matrix, row, col) (matrix[row+col])
>
> the 'macros' are called as follows:
> matrx m;
> double a,b,c;
> a = row;
> b = col;
> c = value;
>
> setvalue(m,a,b,c);
>
> Every time i try to compile the code, i get a 'incompatible type in assignment' (for the setValue calls)
>
> What am i doing wrong here ? Ive gone through the documentation and cant seem to figure it out.
>
> Thanks,
> Aaron
 _______________________________________________
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: #define issues
      • From: Aaron Boothello <email@hidden>
References: 
 >#define issues (From: Aaron Boothello <email@hidden>)

  • Prev by Date: #define issues
  • Next by Date: Re: #define issues
  • Previous by thread: #define issues
  • Next by thread: Re: #define issues
  • Index(es):
    • Date
    • Thread