Array (little but annoying) problem

Hey, I am trying to read a sensor and storing the values in an array, but I can't even manage to print the values of a constant filled array...

This is the code I am using to print the array

void setup()
{
  Serial.begin(9600);
}

int result[20]={1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,10};
int j=0;

void loop()
{
  for(j=0;j<20;j++);
  {
    Serial.print(result[j]);
  } 
  Serial.println();
}

I get this as an output:

0
0
0
0
0
0
0
0
0
0
zeros all the way...

You have a ; after the for, this stops what is in the brackets from running.

so replace
for(j=0;j<20;j++);

with
for(j=0;j<20;j++)

Oh!
Thanks a lot ::slight_smile: