Hello forum
I have the following code already filling my Array1 with numbers.
I would like the same two for-loops to also fill my Array2.
int Array1[9];
int Array2[9];
int data = 0;
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
for (int i = 0; i < 9; i++)
{
Array1[i] = data; // Is it possible to substitute "Array1" with some kind of variable?
data++;
}
for (int i = 0; i < 9; i++)
{
Serial.print(Array1[i]);
}
}
void loop() {
// put your main code here, to run repeatedly:
}
Is it possible to substitute the Array1 with a variable or something which could later point to Array2?
adding: Array2 = data; is not an option in this case, since I will have a lot of different arrays
Best regards
Joe