我在编译期间收到此错误:
“c:\command_line.h(17): 错误 C2143: 语法错误: 缺少';' 在 '*' 之前注意:C++ 不支持 default-int command_line.h(17):错误 C4430:缺少类型说明符 - 假定为 int。注意:C++ 不支持 default-int"
这是我的代码:
命令行.h
typedef struct symbol
{
char* sym_type;
unsigned short address;
}symbol;
typedef struct symbol_map
{
char** p_arr_keys;
symbol* p_arr_values;
int item_count;
int array_mode;
int copy_keys;
}symbol_map;
typedef struct params
{
int data_counter;
int code_counter;
int line_counter;
int command_len;
int error_counter;
int warning_counter;
symbol_map* p_symbol_map; // (This is line 17- from the error msg)
char* p_last_symbol
}params;
主程序
params config;
config.code_counter = 0;
config.data_counter = 0;
config.line_counter = 0;
config.command_len = 0;
config.command_first_char = EMPTY;
config.error_counter = 0;
config.warning_counter = 0;
config.p_last_symbol = NULL;
config.p_symbol_map = {NULL}; // (This is line 17- from the error msg)
知道这个初始化有什么问题吗?
config.p_symbol_map = {NULL};