Hello,
I have a firmware application that works well where I display simple text messages on an LCD screen. At the moment, the User Interface is only in English and I have the text strings simply declared as follows:
Code:
static char msg1[] = " Welcome ";
static char msg2[] = " Data Read ";
//etc...
I want to add a variable that can set the language dynamically from an external device, and so I thought I could do the following:
Code:
#define ENG 0
#define FRE 1
#define GER 2
//...
static char msg1[ENG][] = " Welcome ";
static char msg2[ENG][] = " Data Read ";
//...
static char msg1[FRE][] = " Bienvenue ";
static char msg2[FRE][] = "Données lues ";
//...
//etc...
char cLang = 0; //English is default
writeLCD(msg1[cLang][]);
When I try to compile the above I get a compiler error at the "static char msg..." declarations. The error is: "error: array type has incomplete element type"
Is this method valid, but I have a simple syntax problem with the arrray declarations?
Or is this method unworkable and I should find a different method? If so, any suggestions?
Thanks for any help
Cheers