C++ 全局 静态结构体变量的初始化
发布网友
发布时间:2022-05-01 16:06
我来回答
共1个回答
热心网友
时间:2022-06-19 06:17
typedef struct ReservedInfo {
const string sKey;
const TokenType iToken;
}RESERVEDINFO;
static RESERVEDINFO stReservedInfo[MAXRESERVED] = {
{"function", FUNCDEF},
{"NULL", NULLVAL},
{"if", IF},
{"elseif", ELSEIF},
{"else", ELSE},
{"while", WHILE},
{"break", BREAK},
{"continue", CONTINUE},
{"return", RETURN},
{"atof", FUNCTION},
{"ceil", FUNCTION},
{"floor", FUNCTION},
{"abs", FUNCTION},
{"index", FUNCTION},
{"substr", FUNCTION},
{"strlen", FUNCTION},
{"trim", FUNCTION},
{"replace", FUNCTION},
{"split", FUNCTION},
{"printf", FUNCTION}
};