Multiple variables within loops

uhm... here's my code and what I intend to do but it's not possible:

My global variables:

int grupos = 2; // Let's say X in a future

byte outputAddress0[8] = {22,23,24,25,26,27,28,29};
byte outputAddress1[8] = {30,31,32,33,34,35,36,37};
// byte outputAddressX[8] = {n,n,n,n,n,n,n,n};

int outputQuantity = 8; // Or increase/decrease the array size
boolean outputStatus0[8];
boolean outputStatus1[8];
//boolean outputStatusX[8];
void readOutputStatuses(){
  for (int group = 0; group < grupos; group++){
    Serial.print("Grupo ");
    Serial.print(group);
    Serial.print(": ");
    for (int var = 0; var < outputQuantity; var++)  { 
      outputStatus(group)[var] = digitalRead(outputAddress(group)[var]);
      Serial.print(outputStatus(group)[var]);
    }
    Serial.println();
  }
}

This way I can just increase the number of arrays (groups) in a future without having to use more memory. so I want to build the variable name with the first for to use in the second for inside of it but I'm having problems with this and I want to know if it's even possible to do it. My code uses 96% of the mega's memory and I'm debugging it and put it on a diet, this case repeats multiple times in my code. Thanks for the help.

Cool! Something for nothing AND a free lunch. Please post when you get it finished.

Well my brain stopped working for a few minutes, econjack I didn't got your comment.

And I was an idiot because I could've used arrays but I never use them before.

Variables:

int grupos = 2;

byte outputAddress[2][8] = {
  {22,23,24,25,26,27,28,29}, 
  {30,31,32,33,34,35,36,37}
};

boolean outputStatus[2][8];

Code

void readOutputStatuses(){
  for (int group = 0; group < grupos; group++){
    Serial.print("Grupo ");
    Serial.print(group);
    Serial.print(": ");
    for (int var = 0; var < outputQuantity; var++){
      outputStatus[group][var] = digitalRead(outputAddress[group][var]);
      Serial.print(outputStatus[group][var]);
    }
    Serial.print(", ");
  }
}

This was my first Arduino post and I solved it after a headache >.<

Chuywaka:
I solved it after a headache >.<

That's the normal way.

Welcome to the club.

...R