Multiple Integers

How do you do multiple integers? As in if I want to do:

int pot1;
int pot2;
int pot3;
............

How do I do it in one line? I've done it before, but I forgot how.

Also, this peobably has been asked a lot before, but I couldn't figure out what it was called, so I couldn't look it up.

1 Like

Put a comma between the names:

int one, two, three;

Though I really don't recommend you do this. You way you show makes it clear what each variable type is, and it's easier to delete a variable if the need for it goes away.

I thought there was another way... Like how you do the pinmode for multiple pins.

You calculate how many there are, and then do the variable... Like:

(calculate "i" here)
int Pot

Arrays? Is that what you are alluding to?
http://arduino.cc/en/Reference/Array

int myInts[6];

I think so. I saw that page when I was researching, and I didn't read it all. I thought it was for like 8X8's and that...

Thanks for your help!