• 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: p3consulting <email@hidden>
  • Date: Sat, 16 Apr 2005 10:25:21 +0200


#define setvalue(matrix, row, col, value) ( matrix[row+col] = value) //roughly looks like this



row + col ?

0 + 3 = 3 + 0

and obviously is not what you want...

((row * 4) + col)
((0 * 4) + 3) == 3 and ((3 * 4) + 0) == 12

+

row and col being indices in an array
should be int not double...


(#define are not a good idea for this kind of application..., just an opinion)



Pascal Pochet email@hidden ---------------------------------- PGP KeyID: 0x208C5DBF Fingerprint: 9BFB 245C 5BFE 7F1D 64B7 C473 ABB3 4E83 208C 5DBF

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Re: #define issues
  • Next by Date: Re: #define issues
  • Previous by thread: Re: #define issues
  • Next by thread: Re: #define issues
  • Index(es):
    • Date
    • Thread