flowcode v2 array

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
Jodam
Posts: 2
Joined: Thu Apr 03, 2008 3:52 pm
Contact:

flowcode v2 array

Post by Jodam »

hi I would like learn how to create a simple array with some values in c language.
And How can I integrate the program into the algorigram.
Thanks...

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: flowcode v2 array

Post by Benj »

Hello

To create a simple array in C you would do the following.

char array1[20]; //This defines an unintialised array of 20 bytes indexed 0 - 19

char array2[5] = {0,4,2,'H',0x46}; //This defines an initialised array of 5 bytes indexed 0 - 4

array1[4] = 5; //This assigns the value of 5 to index 4 of array 1.

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: flowcode v2 array

Post by Steve »

In flowcode, you can create an array of bytes by creating a variable called something like "MyVar[16]" - this will create an array with 16 members (MyArr[0], MyArr[1], ... MyArr[15]).

You can interact with these Flowcode variables in C code by refering to them as FCV_MYARR[0], etc.

Post Reply