IonicWind Software

Aurora Compiler => Coding Help - Aurora 101 => Topic started by: pistol350 on June 26, 2007, 01:56:22 AM

Title: Weird C Array synthax
Post by: pistol350 on June 26, 2007, 01:56:22 AM
Hi all !
As this kind of C array synthax is not supported by Aurora,i am searching for another way to get the same results.
here is an example of the weird sythax :

bboxCoords[100][4] ;

I thought something like that could work :

bboxCoords[100,4] ;

What do you think about it ?
Title: Re: Weird C Array synthax
Post by: John Syl. on June 26, 2007, 08:19:06 AM
Assuming bboxcoords is not a string type that should work ok.

I have used a similar int array to control the status a simulated bank of 50 switches, in my case the array buttons[50,4] works fine.

I think that if you access the array through indexes all will be ok but if you try and access directly in memory, I think the layout in Aurora is different to C.

regards
John.
Title: Re: Weird C Array synthax
Post by: sapero on June 26, 2007, 08:22:27 AM
Hi!
You think correctly, [x][y] is same as [x,y] - x arrarys of y elements.
I don't remember when, but sometimes arrays indexed by [x][y] in C, should be converted to [y,x] in aurora.
I had some problems with this while converting OGL examples, but found how to do the conversion - just swapped the parameters.
Title: Re: Weird C Array synthax
Post by: pistol350 on June 26, 2007, 04:08:30 PM
Thank you guys!