help with arrays

I want to store some analog pin numbers in an array. is there anyway to do this?

of course. how about giving it a try?

Arduino array reference.

There may be a hidden question here ... why would you want to store analog PIN numbers .....

hammy:
There may be a hidden question here ... why would you want to store analog PIN numbers .....

For the same reason that you want to store digital pin numbers in arrays?

The analog pins A0 - A5 (on Arduino Uno) can also be called using IDE pin nunbers 14 - 19 respectively. Reference image is attached. Then you can do the same as digital pins:

const uint8_t analogPins[6] = {14, 15, 16, 17, 18, 19};

const uint8_t pinToRead = 0;//analog pin to read 0=A0, 1=A1,...

void setup(){
	//open serial
	Serial.begin(115200);
	delay(250);
	//print analog read w/50ms delay
	while(1){
		Serial.println(analogRead(analogPins[pinToRead]));
		delay(50);
	}
}
void loop(){}

Luckyfish13:
The analog pins A0 - A5 (on Arduino Uno) can also be called using IDE pin nunbers 14 - 19 respectively. Reference image is attached. Then you can do the same as digital pins:

That will break compatibility. If you want to move from an Uno to a Mega, it will no longer work with the given numbers while the below will.

const uint8_t analogPins[6] = {A0, A1, A2, A3, A4, A5};