Variable array dimension sizes in function declaration

Passing a multidimensional array to a function, is there a way to have a variable size for the passed array dimensions? For example:

void Function(uint8_t array[size0][size1][size2]) {}

I found so far I cannot use a variable of any type declared in any scope for the sizes, even when declared constant.

Normally you would calculate the size of the array and pass that into the function with the name of the array.

What is it that you are trying to do ?

You can use function templates:

[color=#5e6d03]template[/color] [color=#434f54]<[/color][b][color=#d35400]size_t[/color][/b] [color=#000000]rows[/color][color=#434f54],[/color] [b][color=#d35400]size_t[/color][/b] [color=#000000]cols[/color][color=#434f54]>[/color] [color=#00979c]void[/color] [color=#d35400]print[/color][color=#000000]([/color][color=#000000]Print[/color][color=#434f54]&[/color] [color=#000000]p[/color][color=#434f54],[/color] [color=#00979c]const[/color] [color=#00979c]uint8_t[/color] [color=#000000]([/color][color=#434f54]&[/color][color=#000000]arr[/color][color=#000000])[/color][color=#000000][[/color][color=#000000]rows[/color][color=#000000]][/color][color=#000000][[/color][color=#000000]cols[/color][color=#000000]][/color][color=#000000])[/color] [color=#000000]{[/color]
  [color=#5e6d03]for[/color] [color=#000000]([/color][color=#00979c]uint8_t[/color] [color=#000000]r[/color] [color=#434f54]=[/color] [color=#000000]0[/color][color=#000000];[/color] [color=#000000]r[/color] [color=#434f54]<[/color] [color=#000000]rows[/color][color=#000000];[/color] [color=#000000]r[/color][color=#434f54]++[/color][color=#000000])[/color] [color=#000000]{[/color]
    [color=#5e6d03]for[/color] [color=#000000]([/color][color=#00979c]uint8_t[/color] [color=#000000]c[/color] [color=#434f54]=[/color] [color=#000000]0[/color][color=#000000];[/color] [color=#000000]c[/color] [color=#434f54]<[/color] [color=#000000]cols[/color][color=#000000];[/color] [color=#000000]c[/color][color=#434f54]++[/color][color=#000000])[/color] [color=#000000]{[/color]
      [color=#000000]p[/color][color=#434f54].[/color][color=#d35400]print[/color][color=#000000]([/color][color=#000000]arr[/color][color=#000000][[/color][color=#000000]r[/color][color=#000000]][/color][color=#000000][[/color][color=#000000]c[/color][color=#000000]][/color][color=#000000])[/color][color=#000000];[/color]
      [color=#000000]p[/color][color=#434f54].[/color][color=#d35400]print[/color][color=#000000]([/color][color=#00979c]'\t'[/color][color=#000000])[/color][color=#000000];[/color]
    [color=#000000]}[/color]
    [color=#000000]p[/color][color=#434f54].[/color][color=#d35400]println[/color][color=#000000]([/color][color=#000000])[/color][color=#000000];[/color]
  [color=#000000]}[/color]
  [color=#000000]p[/color][color=#434f54].[/color][color=#d35400]println[/color][color=#000000]([/color][color=#000000])[/color][color=#000000];[/color]
[color=#000000]}[/color]

[color=#00979c]void[/color] [color=#5e6d03]setup[/color][color=#000000]([/color][color=#000000])[/color] [color=#000000]{[/color]
  [b][color=#d35400]Serial[/color][/b][color=#434f54].[/color][color=#d35400]begin[/color][color=#000000]([/color][color=#000000]115200[/color][color=#000000])[/color][color=#000000];[/color]
  [color=#5e6d03]while[/color] [color=#000000]([/color][color=#434f54]![/color][b][color=#d35400]Serial[/color][/b][color=#000000])[/color][color=#000000];[/color]

  [color=#00979c]const[/color] [color=#00979c]uint8_t[/color] [color=#000000]arr[/color][color=#000000][[/color][color=#000000]][/color][color=#000000][[/color][color=#000000]3[/color][color=#000000]][/color] [color=#434f54]=[/color] [color=#000000]{[/color]
    [color=#000000]{[/color][color=#000000]11[/color][color=#434f54],[/color] [color=#000000]12[/color][color=#434f54],[/color] [color=#000000]13[/color][color=#000000]}[/color][color=#434f54],[/color]
    [color=#000000]{[/color][color=#000000]21[/color][color=#434f54],[/color] [color=#000000]22[/color][color=#434f54],[/color] [color=#000000]23[/color][color=#000000]}[/color][color=#434f54],[/color]
    [color=#000000]{[/color][color=#000000]31[/color][color=#434f54],[/color] [color=#000000]32[/color][color=#434f54],[/color] [color=#000000]33[/color][color=#000000]}[/color][color=#434f54],[/color]
    [color=#000000]{[/color][color=#000000]41[/color][color=#434f54],[/color] [color=#000000]42[/color][color=#434f54],[/color] [color=#000000]43[/color][color=#000000]}[/color]
  [color=#000000]}[/color][color=#000000];[/color]

  [color=#d35400]print[/color][color=#000000]([/color][b][color=#d35400]Serial[/color][/b][color=#434f54],[/color] [color=#000000]arr[/color][color=#000000])[/color][color=#000000];[/color]
[color=#000000]}[/color]

[color=#00979c]void[/color] [color=#5e6d03]loop[/color][color=#000000]([/color][color=#000000])[/color] [color=#000000]{[/color][color=#000000]}[/color]

Pieter