Create array and how to pass to a routine

I need to create an array for groups to pass into a routine: I currently pass my_TO which is a 0 or 1 i also want to pass the led_Pin??.
I not sure how to setup and pass on the array do you need to define the leds as object?

void do_Turn_ON_OFF(int my_TO) // Turn on or off all of the leds in each group
{
switch (my_TO)
{
case 1: //on
{
digitalWrite(led_pin1B, HIGH);
digitalWrite(led_pin1C, HIGH);
delay(1);
break;
}
case 0: //off
{
digitalWrite(led_pin1B, LOW);
digitalWrite(led_pin1C, LOW);
delay(1);
break;
}
default:
break;
}

}

int x[4];
x[0] = 12;
x[1] = 4;
x[2] = 5;
x[3] = 1;
processArray(x);

void processArray(int *x) {
digitalWrite(x[0], HIGH);

}

The easier you make it to read and copy the code the more likely it is that you will get help

Please follow the advice given in the link below when posting code

Just add the pin number arguments to the function?
void do_Turn_ON_OFF(int my_TO, int Pin1, int Pin2) // Turn on or off all of the leds in each group

Or are the ‘groups’ of varying size? Are they contiguous in an array? If so, you can pass an address and a count:
void do_Turn_ON_OFF(int my_TO, int *PinPointer, int count) // Turn on or off all of the leds in each group

Note: There is not enough context in your function to know what you want. Include the declaration of any variables used and the code that calls the function.

Thank you all for responding - I think perhaps I have solved my little issue but am open to any suggestions to improve my coding. Currently I am using the UNO to turn my test lights on/off but eventually would like to use a number of shift registers. So I am trying to make it as easy as I can to accomplish this.

This project is to control all the signal lights on my model railway.
I apologize in advance for not being familiar with this site - I am learning…

this is the code:

/*Shift registers are not currently being used - they will be when the wiring/coding works from the UNO.R3


    Group 1  switch = 1A      // Control toggle on shift register slave #1
              led   = 1B      // Control led - on/off depending on the state of the toggle
              led   = 1C      // Control led - off/on depending on the state of the toggle

              led   = 1DR     // Turnout number 1 = red         - shift register - daisy 1
              led   = 1DG     // Turnout number 1 - green

              led   = 2DR     // Turnout number 2 = red         - shift register - daisy 1
              led   = 2DG     // Turnout number 2 - green

              led   = 3DR     // Turnout number 3 = red         - shift register - daisy 1
              led   = 3DG     // Turnout number 3 - green

              led   = 4DR     // Turnout number 4 = red         - shift register - daisy 1
              led   = 4DG     // Turnout number 4 - green

     each Group consists of all of the above and are assigned to a slave shift register

     VERSION 1 - 2021.
*/



// THESE DO NOT CHANGE
// Variables pins from the UNO R3
const int switch_pin1A = 8;       // group 1 array 0
const int led_pin1B = 2;
const int led_pin1C = 4;

const int switch_pin2A = 0;       // group 2 array 1
const int led_pin2B = 0;
const int led_pin2C = 0;

const int switch_pin3A = 0;       // group 3 array 2
const int led_pin3B = 0;
const int led_pin3C = 0;

//Variables for the Group
const int numberof_Groups = 1;// zero based
const int groupArray[][10] {
  {0, switch_pin1A, led_pin1B, led_pin1C, 0, 0, 0, 0, 0, 0},
  {1, switch_pin2A, led_pin2B, led_pin2C, 0, 0, 0, 0, 0, 0},
  {2, switch_pin3A, led_pin3B, led_pin3C, 0, 0, 0, 0, 0, 0}
};// not all o the array is currently used




// THESE DO CHANGE
// variables to hold the new and old switch states and to determine the current state of the switch
boolean oldSwitchState = LOW;
boolean newSwitchState1 = LOW;
boolean newSwitchState2 = LOW;
boolean newSwitchState3 = LOW;
boolean switchPressed = false;
//........................................................................................


void setup()
{
  Serial.begin(9600);
  //Define
  for (int x = 0; x < numberof_Groups; x++)
  {
    pinMode(groupArray[x][1], INPUT);
    pinMode(groupArray[x][2], OUTPUT);
    pinMode(groupArray[x][3], OUTPUT);
    Serial.print(" x value "); Serial.println(x);
  }


  //Check that the leds work
  do_Turn_ON_OFF(1); // 0 is OFF 1 is ON
}

void loop()
{
  //Step 1 Check the state of the toggle switch for each control group
  for (int x = 0; x < numberof_Groups; x++)
  {
    do_Switch_Check(groupArray[x][1]);

    //Step 2 show one led depending on toggle switch position
    if ( switchPressed )
    {
      digitalWrite(groupArray[x][2], LOW);
      digitalWrite(groupArray[x][3], HIGH);
    }
    else
    {
      digitalWrite(groupArray[x][2], HIGH);
      digitalWrite(groupArray[x][3], LOW);
    }
  }
}//..................................................................

void do_Turn_ON_OFF(int my_TO)  // Turn on or off all of the leds in each group
{
  switch (my_TO)
  {
    case 0:  //OFF
      {
        for (int x = 0; x < numberof_Groups; x++)
        {
          pinMode(groupArray[x][2], LOW);
          pinMode(groupArray[x][3], LOW);
        }

        delay(100);
        break;
      }
    case 1:  //ON
      {
        for (int x = 0; x < numberof_Groups; x++)
        {
          pinMode(groupArray[x][2], HIGH);
          pinMode(groupArray[x][3], HIGH);
        }
        delay(100);
        break;
      }
    default:
      break;
  }

}//...................................................................................

void do_Switch_Check(int my_pin_switch) //check the state of the switch 
{
  newSwitchState1 = digitalRead(my_pin_switch);      delay(1);
  newSwitchState2 = digitalRead(my_pin_switch);      delay(1);
  newSwitchState3 = digitalRead(my_pin_switch);

  if (  (newSwitchState1 == newSwitchState2) && (newSwitchState1 == newSwitchState3) )
  {
    if ( newSwitchState1 != oldSwitchState )
    {
      if ( newSwitchState1 == HIGH ) {
        switchPressed = true;
      } else {
        switchPressed =  false;
      }
      oldSwitchState = newSwitchState1;
    }
  }

}//...................................................................................

Thanks for update and quick reply. I’ll be sure to keep an eye on this thread. looking for the same info.

Official Site