May 16, 2024, 03:16:51 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Weird C Array synthax

Started by pistol350, June 26, 2007, 01:56:22 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pistol350

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 ?
Regards,

Peter B.

John Syl.

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.
Intel 3.6 p4 ht, XP home,2 gb mem, 400 gb hd 20gb raid 0, Nvidia 6600le.
AMD k6-2 500, 40gb.

Started on PDP11 Assembler, BASIC, GWBASIC, 6502, Z80, 80x86, Java, Pascal, C, C++, 
IBasic (std & pro), Aurora, EBasic.  (Master of none, but it's been fun!)

sapero

June 26, 2007, 08:22:27 AM #2 Last Edit: June 26, 2007, 08:24:52 AM by sapero
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.

pistol350

Regards,

Peter B.