Hi!
I'm using String object to manipulate text, but I decided to go by char arrays.
But I'm having problem accessing the char arrays
The code below I'm using String object:
String myString[3][2] = {{"Abcdefgh"},{"RandomText"},
{"12345678"},{"Dont know"},
{"JustAtest"},{"OtherTest"}};
void setup() {
Serial.begin(115200);
printArray((String*)myString,2,3);
}
void loop() {
// Nothing
}
void printArray(String* Array, int Columns, int Rows){
for(int j=0 ; j<Columns ; j++)
for(int i=0 ; i<Rows ; i++)
Serial.println(Array[j*Rows+i]);
}
I can pass and access the members, it works perfectly.
But I don't know how to pass char arrays to the function.
I declared it like this:
char myArray[][2][11] = {{"Abcdefgh"},{"RandomText"},
{"12345678"},{"Dont know"},
{"JustAtest"},{"OtherTest"}};
//First Dimension = Rows
//Second Dimension = Columns
//Third Dimension = Text Max Length
I've tried accessing it like String object array and other ways, but it doesn't work.
Seeing it, the most difference is that I have to specify the Text Max Length as fixed in char arrays.
I want to pass the columns, rows and text length in the function and not declare it fixed globally.
Some help please?
Thanks!