how to deal with arrays in C code block or any other way

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
zenzehar
Posts: 21
Joined: Sat Nov 01, 2008 4:00 pm

how to deal with arrays in C code block or any other way

Post by zenzehar »

how to deal with arrays in flowcode??!!...
in conventional c ccode i used to declare an array like:
int x[80];
this one worked and was compiled
but when i tried to access any element in ths array by writing a c code block like --> x[k]=0;
while k is a flow code declared variable (integer) ...
it gives compilation errors ... please help me

i think that there is a way to make c code block interactes with flowcode declared variables .....

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

Re: how to deal with arrays in C code block or any other way

Post by Steve »

If you have a variable "MyVar" declared within Flowcode, you need to refer to it as "FCV_MYVAR" within any C code you use.

So with your code, if x[80] is adeclared within the C code and "k" is declared within Flowcode, you need to do the following:

x[FCV_K] = 0;

Post Reply