How I can use the value inside a FOR in my code?

maybe my question isnt understandable, but here is what i want to do:
i have a typical for statement:

for(int a=0,a<20,a++)

and in my code (inside the FOR)I want to use the “a” for something, for example:

int example = 0;
example = example + a;
Serial.print(a,DEC);

but in te serial I only receive a=0, every time.
(the sketch compile right and upload successful to my arduino)

I already read the FAQ and the FOR Statement part, but I can’t resolve my problem. I already try declaring “a” before the for but that naither works.

and the value “example” neither change their value in every cycle.

and if you can tell me, what is DEC (in the serial print) and what other options exist instead DEC) I read a little and I “understand” it was for indicate the type of character, but im not entirely sure.

Thank you!

(Sorry for my english)

for(int a=0 ; a<20 ; a++)

yes, you are right with ";" instead "," but this was only an ilustrative example, in my code I had ";" and my sketch was succesfully uploaded to the card, in fact the for is working, the instructions inside aare running, but the detail is that when I need to use the variable as a "counter" I can't obtain the real value of the "a"

anyway, thank you

an idea?

for(int i = 0; i < 255; i++)
{
Serial.println(i);
}

Should be just like that? It should then return i.

DEC is for decimal and is optional. Other options include HEX, BIN, OCT, BYTE for hexadecimal, binary, octal, or raw byte value.

Are you absolutely sure the place where you use the variable a inside the for loop? As shown, it will only be visible inside the loop.

Complete code would definately help.

yes, you are right with ";" instead "," but this was only an ilustrative example, in my code I had ";"

In which case, you've wasted your time and mine.

an idea?

If you want help, post your entire Sketch. Please use code tags.

sorry Coding Badly, my mystake =S

So do you still have a problem with this?