以下包含指令将抛出以下错误:
GCC Compiler) ===|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Length'|
我正在使用代码块。该文件有什么问题(改写:删除分号)
typedef struct xxxListItem{
void *data;
struct xxxListItem *next
}XXXList;
#define XXX_RESULT int
#define XXX_OK 0
#define XXX_MEMORY_ERROR 1
#define XXX_OUT_OF_BOUNDS 2
/*Makros
Keine */
//Prototypen
XXX_RESULT xxx_List_Create(XXXList **pp_list);
XXX_RESULT xxx_List_Insert(XXXList **pp_list, void *p_data);
XXX_RESULT xxx_List_Delete(XXXList **pp_list,int index);
XXX_RESULT xxx_List_Length(XXXList *p_list); //this seems to be faulty!
void xxx_List_Show(XXXList *p_list);
这里是主要部分
#include <stdio.h>
#include <stdlib.h>
#include "XXXList.h"
int main(){
printf("Hello world!\n");
return 0;
}
最佳答案
正如 Jonathan Leffler 所提到的,您缺少一个分号:
typedef struct xxxListItem{
void *data;
struct xxxListItem *next; // <--- right here!
}XXXList;
关于c - 包括因语法错误而崩溃的 .h 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52456208/