MASSIMA URGENZA (per programmatori in C)
Aiutatemi vi prego, stasera mi scade la consegna di un esercizio all' universita e se non lo consegno probabile che non passero l' esame.
Dunque il problema è un po particolare, il compilatore dice : "dereferencing pointer to incomplete type".
io sto usando una serie di strutture una dentro l' altra che vi mostro qui in seguito, la funzione riceve in input un puntatore alla strutturs piu esterna e io devo puntare quella piu interna, vi prego vedete voi se riuscite a scovare qualche errore:
typedef struct tabelem{ //elemento
char *key;
void *info;
}tabelem,*punta_elem;
typedef struct telist{ //listone di elementi aggiunti non ordinati
struct tabelem *el;
struct telist *next;
}telist,*listone;
typedef struct NODE{ //nodo della lista della tavola
struct tabelem *node_el;
struct NODE *next;
}NODE,*LISTA_NODE;
typedef struct HASHTABLE{ //tavola hash (vettore di puntatori a NODO)
struct NODE *vettore[MAX_LENGHT+1];
}HASHTABLE;
typedef struct table{
struct HASHTABLE htable;
struct telist *ls;
}table,*punta_table;
struct info_word {
char *parola;
int word_pos;
int title;
int italic;
int bold;
size word_size;
char *file_link;
int link_pos;
};
struct elem_hitlist {
struct info_word *info_occ_word;
struct elem_hitlist *next_elem;
};
struct elem_diz_loc {
char *parola;
struct elem_hitlist *hitlist;
int dim;
struct elem_diz_loc *next_word;
};
struct info_link {
struct tabelem *ptr_pagina;
int molteplicita;
struct info_link *next;
};
struct info_ipertesto {
struct info_link *lista_in;
struct info_link *lista_out;
struct elem_diz_loc *diz_loc;
int page_rank;
};
e la funzione è questa,
void crea_diz_ipertesti(struct table *t){
// dichiarazioni
FILE *pfile;
int i=0;
char *nfile;
struct elem_diz_loc *DIZ;
init_diz_iper(t); // inizializza le liste che conterranno
// tutti i dizionari locali presenti in un file
do{
strcpy(nfile,(t)->htable->vettore[i].elnodo->key);
pfile=fopen(nfile,"r");
((struct info_ipertesto *)t->htable->vettore[i].elnodo->info)->diz_loc=crea_diz_loc(DIZ,pfile);
rewind(pfile);
((struct info_ipertesto *)t->htable->vettore[i].elnodo->info)->lista_in=crea_lista_in(t,i,pfile);
rewind(pfile);
((struct info_ipertesto *)t->htable->vettore[i].elnodo->info)->lista_out=crea_lista_out(t,pfile);
i++;
fclose(pfile);
}while(t->htable->vettore[i]!=NULL);
|