CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How to use the fonction with const char pointer in parameter

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Dany



Joined: 23 Feb 2005
Posts: 1

View user's profile Send private message

How to use the fonction with const char pointer in parameter
PostPosted: Wed Feb 23, 2005 2:50 am     Reply with quote

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 Confused
Ttelmah
Guest







PostPosted: Wed Feb 23, 2005 4:21 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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