c - 包括因语法错误而分解的 .h 文件
问题描述
以下包含指令将抛出以下错误:
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;
推荐阅读
- python - 如何使用 BeautifulSoup 抓取非 HTML 标签
- rest - 如何使用 odoo 12 调用和读取 API REST(从我的应用程序到 odoo)
- javascript - 函数式编程:当输入需要改变时,如何将不纯函数转换为纯函数
- python - 使用 PyMC3 进行贝叶斯校准,Kennedy O'Hagan
- java - java中的Map.compute函数
- android - 自 Xamarin.Forms 中的按钮以来,我如何获取功能或创建调用主详细信息页面或菜单的按钮?
- python - 如何识别声音信号中的单词发音
- c++ - 如何制作一个类的对象数组但用户提供输入?
- c - 匹配数组中的元素
- java - 如何将数组排序为工作日格式android