だから私はかなり長い間これに取り組んできましたが、問題を見つけることができないようです.私の先生でさえそれを見つけることができませんでした.
だから私はこのヘッダーファイルを持っています:
#include <stdio.h>
#include <stdbool.h>
void print_list(void);
int delete_from_list(int iWordID);
wordData * create_list(int iWordID, char * cWord);
wordData * add_to_list(int iWordID, char * cWord, bool add_to_end);
wordData * search_in_list(int iWordID, struct wordData **prev);
void print_list(void);
typedef struct _wordData
{
int iWordID;
char * cWord;
struct _wordData *next;
} wordData;
そして、このヘッダーをインクルードする C ファイルには、次の関数があります。
wordData* create_list(int iWordID, char * cWord)
{
//printf(cWord);
printf("\n creating list with headnode as [%d] %s\n",iWordID,cWord);
wordData *ptr = (struct wordData*)malloc(sizeof(struct wordData));
if(NULL == ptr)
{
printf("\n Node creation failed \n");
return NULL;
}
ptr->iWordID = iWordID;
//char * temp = (char*)malloc(sizeof(cWord));
ptr -> cWord = cWord;
ptr->next = NULL;
head = curr = ptr;
return ptr;
}
したがって、コンパイルすると次のエラーが発生します: list.h|6|error: expected '=', ',', ';', 'asm' or ' attribute ' before '*' token|
このエラーでかなりの数の awners を検索しましたが、私を助けるものを見つけることができないようです。
助けてください :)