Hello,
I am trying to initialize an array of pointers to an array of characters, I can do it in 3 lines but I really want to do it in one line at the same time keeping the #define.
3 lines initialization (can compile)
=============== =======
#define A 1
#define B 2
char row1[] = {A|B, B, A};
char row2[] = {B, A};
char *test[]= {row1, row2};
1 line initialization (failed)
=============== =============== =
char *test[] = { {A|B, B, A}, {B, A} }; // <- how do i do this??
I do not want this because it waste ROM space
=============== =============== ===============
char test[][3] = { {A|B, B, A}, {B, A} };
Much appreciate if anyone can give me some pointers, thnx - paul.
I am trying to initialize an array of pointers to an array of characters, I can do it in 3 lines but I really want to do it in one line at the same time keeping the #define.
3 lines initialization (can compile)
=============== =======
#define A 1
#define B 2
char row1[] = {A|B, B, A};
char row2[] = {B, A};
char *test[]= {row1, row2};
1 line initialization (failed)
=============== =============== =
char *test[] = { {A|B, B, A}, {B, A} }; // <- how do i do this??
I do not want this because it waste ROM space
=============== =============== ===============
char test[][3] = { {A|B, B, A}, {B, A} };
Much appreciate if anyone can give me some pointers, thnx - paul.
Comment