what is the correct format for using a variable in a void?

int p[] = {60,24,24,24,24,24,56,24};
int p2[] = {126,62,24,12,6,6,126,60};
int p3[] = {60,126,6,30,30,6,126,60};

void setup() {


}

void loop() {

 case 83595375:     matrixx(p);     break;  // push button 1
 

 case 83605575:

    if (matrix == 1 && display == 0)
    {
      for (n=0;n<8;n=n+1) 
      {
      lc2.setColumn(0,(n),(p2[n]));
      }
    }
    break;                                                 // push button 2
}


void matrixx(int r)
{
   if (matrix == 1 && display == 0)
    {
      for (n=0;n<8;n=n+1)
      {
      lc2.setColumn(0,(n),(p[n]));
      }
    }
}

I have added a small part of my program above.
I am using an old tv remote to drive a matrix board via a max 7219.
The program that contains the bit above works.
the array p runs in the void matrixx.

What I would like to do is use the void matrixx to put different symbols on the matrix board.
I hoped I could do this by making the p in the line

lc2.setColumn(0,(n),(p[n]));

in the void matrixx into a variable and alter it with the (int r) as in

void matrixx(int r)

then calling it with

matrixx ( p1 or p2 or p3 )

from within a case but every method I have tried has failed.

Is there a way of doing this?

thanks.

void loop() {

 case 83595375:     matrixx(p);     break;  // push button 1

You're missing a switch.

They're called "functions", not "voids"

Posting snippets simply wastes time. Do you have time to waste?

You must have been told before, it's NOT a void! That's just the return type (of the lack of it), its just a function.

And why give it a parameter r and do nothing with it?

And using meaningless variable names is already not smart, giving globals a single letter name is just plain stupid...

And why define something as int while it doesn't go over 255 nor negative?

But this does the trick

void matrixx(int in[]){

}

Only thing, you can NOT use sizeof() inside the function.