I have an Arduino sketch that passes an array into a method as a compound literal, but for some reason I keep getting the following error:
void setup() { }
void printConcatLine(char chunks[][20]) { }
void loop() {
printConcatLine((char[][20]){ "{", "255", "}" });
}
I've also tried passing the number of the pointers/length of the array, and explicitly terminating it:
void setup() { }
void printConcatLine(char *chunks[]) { }
void loop() {
printConcatLine((char*[]){ "{", "255", "}", NULL });
}
...and
void setup() { }
void printConcatLine(char chunks[][20]) { }
void loop() {
printConcatLine((char[][20]){ "{", "255", "}", "" });
}
But they both produce the same error.
What is the correct method of passing the compound literal array as a method parameter?