Galera preciso de uma ajuda pra intender porque não é possivel compilar o programa o problema é q eu não consigo inicializar um item do jeito que esta ai o erro é Item.c:13: error: request for member ‘key’ in something not a structure or union
Item.c:14: error: request for member ‘type’ in something not a structure or union
Item.c:15: error: request for member ‘data’ in something not a structure or union
Item.h
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "DinamicList.h"
#define key(A) (A)
#define NULLItem NULL
struct Item {
void *key;
int type;//da chave
Data data;
};
typedef struct Item* item;
void flush_in();
char *substring(size_t start, size_t stop, const char *src, char *dst, size_t size);
//Definição de item-------------------------------------------------------------
void initItem(item*);
int emptyItem(item);
void insertItem(item*);
void insertItemKey(item* , char *);
void insertItemData(Data *, char *);
void printItem(item);
Item.c
void initItem(item* ite) {
ite->key = NULL;//aqui eu já tentei colocar de tudo....
ite->type = -1;
initList(&ite->data);
}
int emptyItem(item ite) {
//Data *x = ite.data;
if (emptyList(/**x*/ite->data) && ite->key == NULL)
return 1;
else
return 0;
}
DinamicList.h
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct node {
void *info;
int type;//0-char 1-int
struct node *prox;
};
typedef struct node Node;
typedef Node *Data;
//Definição de lista enc/din----------------------------------------------------
void initList(Data*);
int emptyList(Data);
int completLstInt();
char* completLstStr();
int insertNode(Data *, int);
//int removeNode(Data *,void*,int);
int countItemData(Data);
void printLst(Data);