Keil Logo Arm Logo

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

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Degang Zou
Posted
2-Nov-2002 09:38 GMT
Toolset
C51
New! 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?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.