我有以下内容;
const CHAR string_1[] PROGMEM = "String 1";
const CHAR string_2[] PROGMEM = "String 2";
const CHAR string_3[] PROGMEM = "String 3";
const CHAR string_4[] PROGMEM = "String 4";
const CHAR string_5[] PROGMEM = "String 5";
const CHAR *string_table[] PROGMEM =
{
string_1,
string_2,
string_3,
string_4,
string_5
};
我将如何保存 string_table 的这个地址,以便我可以在函数中调用它;
CHAR acBuffer[20];
UCHAR ucSelectedString = 2; // get string number 3
//
pcStringTable = string_table ...?? What is the proper line here??
//
strcpy_P(acBuffer, (char*)pgm_read_byte(&(pcStringTable[ucSelectedString])))
根据下面的评论,我也改变了结构;
typedef struct
{
...
CHAR **pasOptions;
然后我尝试分配string_table
给它;
stMenuBar.pasOptions = string_table;
编译器抛出这个警告;
warning: assignment from incompatible pointer type
还有什么想法吗?