Interface arduino with C#

Hi, I'm using C# to send values to my arduino such as 12 and 24 to my arduino. I've got the coding were my arduino reads 12 if i send <12> from C# and when i send * an infinte for loop is activated. Now I got the infinite for loop to go from 0 to 15 and start again from 0 to 15 and this will keep on going until the arduino is switched on.

my infite for loop
for (int b = 0; b<17; b++)
{
look what is the value of serialValue
** and do something**
}
I did this infinite for loop because i'm storing the C# values on the ardunio, which are then stored in an array called serialValues__, and when i send * from C# the infinte loop starts.__
As explaind i want the arduino to go through all the values it received and if it receives 12 and pin 10 is high then pin 12 is high etc..
the problem i'm facing is that when the infite loop starts again from 0 and the value 12 reappeard from the array and pin 10 is low, pin 12 remains high and i want it to go LOW. And when b starts from 0 again and pin 10 is high i want pin12 u go high again
HERE is my coding I would appreciate any help cause i'm a college student and i need to solve this problme ASAP
#

First of all your for loop by itself is not infinite, unless placed inside another loop. Also the way that it is setup now it goes from 0 to 16 not 15.

if you post your code with a better explanation of what you are trying to do we might be able to help

inf loop would just be a

while(true) {}

or

for (;:wink: {}

Haha, part of your for loop showed up as a smiley!