gpt4 book ai didi

c - 包括因语法错误而崩溃的 .h 文件

转载 作者:行者123 更新时间:2023-11-30 21:36:25 26 4
gpt4 key购买 nike

以下包含指令将抛出以下错误:

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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com