|
|
View previous topic :: View next topic |
Author |
Message |
Dany
Joined: 23 Feb 2005 Posts: 1
|
How to use the fonction with const char pointer in parameter |
Posted: Wed Feb 23, 2005 2:50 am |
|
|
Hi,
I'm working on 18F4620 and with CCS compiler version 3.219
I have created the the fonction with the const char * in parameter. But the compiler didn't accept.
const char MAIN_MENU[9][14] ={{"MENU 1 "},
{"MENU 2 "},
{"MENU 3 "},
{"MENU 4 "},
{"MENU 5 "},
{"MENU 6 "},
{"MENU 7 "},
{"MENU 8 "},
{"MENU 9 "}};
void MEN_GestionListeDeroulant(const char * ListeDesChoix)
{
strcpy(buf_DisplayLine_L1, ListeDesChoix);
LCD_voidPutString(0x80, &buf_DisplayLine_L1[0], 14);
}
MEN_GestionListeDeroulant(&MAIN_MENU[0][0]);
The compiler is tell me an error on this function.
Thanks.
Dany |
|
|
Ttelmah Guest
|
|
Posted: Wed Feb 23, 2005 4:21 am |
|
|
The compiler does not support pointers to constant values. Hence you will need either to move the variable into RAM, where pointers can be used, or consider passing the function just the index of the array, and with the array as a global variable, then do the array access inside the function.
Best Wishes |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|