This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to get a string from a constant array which located in BANKn?

Help me:How to get a string from a constant array which located in BANKn?

//Located at BANK0
code char *pStrArray[] = {
   "1",
   "2",
   "34",
};				

//Located at BANK0
void LoadString(char *strbuf, const char *pString){
   BYTE iBank;

   iBank = get_bank();
   switchbank(RES_BANK);
   strcpy(strbuf, pString);

   switchbank(iBank);
}

//Located at BANK1
void GetString(char *strbuf, const char *pStr[], unsiged char i){
   LoadString(strbuf, pStr[i]);
}

//the result is null string, why?