V
vib
Hi there,
I wish to get some advice on the problem I face in initializing a
table.
Here is the code. I've an array of strings, ptrNameString . I want to
initialize a table, mySoftKeyTable with some contents of the string
from the array. This initialization is not in any function, but rather
outside of any function. However, the compiler complaints, the related
lines( L1, L2, L3, L4) of "Initializer element is not constant". I
guess, it expects a constant but getting a non-constant instead.
Please advise.
Thanks in advance.
vibnwis
char * ptrNameString [5] = { "One", "Two", "Three", "Four", "Five" };
WWM_SOFTKEY_ITEM_DATA mySoftKeyTable[] =
/* L1 */ {{
/*adrStrings[STR_SETUP].textStr[ENGLISH]*/*(ptrNameString),
(void (* ) (void *)) winHelloCreate, UGL_NULL, 0},
/* L2 */ {
/*adrStrings[STR_DIAL].textStr[ENGLISH]*/*(ptrNameString+1), (void (* )
(void *)) winHelloCreateLine2, UGL_NULL, 1 },
/* L3 */ {
/*adrStrings[STR_REDIAL].textStr[ENGLISH]*/*(ptrNameString+2), (void (*
)
(void *)) winHelloCreateLine3, UGL_NULL, 2 },
/* L4 */ {
/*adrStrings[STR_EXIT].textStr[ENGLISH]*/*(ptrNameString+3),
(void (* ) (void *)) winHelloCreateLine4, UGL_NULL, 3 },
{ UGL_NULL, UGL_NULL, UGL_NULL, UGL_NULL} };
Note: winHelloCreateX are functions.
I wish to get some advice on the problem I face in initializing a
table.
Here is the code. I've an array of strings, ptrNameString . I want to
initialize a table, mySoftKeyTable with some contents of the string
from the array. This initialization is not in any function, but rather
outside of any function. However, the compiler complaints, the related
lines( L1, L2, L3, L4) of "Initializer element is not constant". I
guess, it expects a constant but getting a non-constant instead.
Please advise.
Thanks in advance.
vibnwis
char * ptrNameString [5] = { "One", "Two", "Three", "Four", "Five" };
WWM_SOFTKEY_ITEM_DATA mySoftKeyTable[] =
/* L1 */ {{
/*adrStrings[STR_SETUP].textStr[ENGLISH]*/*(ptrNameString),
(void (* ) (void *)) winHelloCreate, UGL_NULL, 0},
/* L2 */ {
/*adrStrings[STR_DIAL].textStr[ENGLISH]*/*(ptrNameString+1), (void (* )
(void *)) winHelloCreateLine2, UGL_NULL, 1 },
/* L3 */ {
/*adrStrings[STR_REDIAL].textStr[ENGLISH]*/*(ptrNameString+2), (void (*
)
(void *)) winHelloCreateLine3, UGL_NULL, 2 },
/* L4 */ {
/*adrStrings[STR_EXIT].textStr[ENGLISH]*/*(ptrNameString+3),
(void (* ) (void *)) winHelloCreateLine4, UGL_NULL, 3 },
{ UGL_NULL, UGL_NULL, UGL_NULL, UGL_NULL} };
Note: winHelloCreateX are functions.