void setup() {
Serial.begin(9600);
}
void loop()
{
time_Text(2);
}
void time_Text(int PastTo_val) {
switch (PastTo_val) {
case 1:
{
int tPTT_y[] = {11, 11, 11, 11};
int tPTT_x[] = {6, 7, 8, 9};
}
break;
case 2:
{
int tPTT_y[] = {11, 11};
int tPTT_x[] = {10, 11};
}
break;
}
int n_tPTT = sizeof(tPTT_x) / sizeof(tPTT_x[0]);
Serial.print(tPPT_y);
Serial.print(" : ");
Serial.print(tPPT_x);
Serial.print(" : ");
Serial.println(n_tPPT);
}
Hello,
I have a case that i need to assign different kind of array value (with different size per case), and then find the size of the array, and print it, the problem is that the tPTT_y and tPTT_x is a local variable which cannot be accessed outside of the case function. i have tried to declare it before the switch function but i cannot give a size number because the size is different per case, how could i solve this?
Thank you