Buttons initialization ,array of strings problem #1782
Replies: 1 comment
-
So...i finally answer myself, the arduino reference site didn't show all the options and a clear answer was hard to collect all char *keyMoreLabel[] = {"new line","spacing"}; // one dimension pointer char arrays char keyMoreLabel[][10] = {"new line","spacing"}; //two dimension char arrays with room left on second dimension String keyMoreLabel[] = {"new line","spacing"}; //one dimension string array This helped myself: https://www.geeksforgeeks.org/array-strings-c-3-different-ways-create/ they talk also about vector class and array class,but i didn't take these options. |
Beta Was this translation helpful? Give feedback.
-
Hi,bodmer or someone else can answer me :)
I'm trying to initialize an array of strings to give labels to my buttons like this:
char keyMoreLabel[] = {"new line","spacing"};
i had always an error,so i looked over the arduino reference and the solution that they give:
char *keyMoreLabel[] = {"new line","spacing"};
is an array of pointers and it compiled good,but the buttons don't respond to the touch even if they
are well drawed.
Why and when should i use pointers to initialize a char or an an array of strings even if i will not use
the pointers?
Beta Was this translation helpful? Give feedback.
All reactions