我创建了一个结构数据类型并尝试为这些项目的列表动态分配内存,realloc
但它导致:
error C2226: syntax error : unexpected type 'Employee'
文档只是说:在类型说明符之前或之中发生语法错误。
我无法弄清楚这里出了什么问题。
int current_employees=0;
struct Employee *list = 0;
...
current_employees++;
list = struct Employee * realloc((void*) list, current_employees * sizeof(struct Employee));