dereferencing pointer to incomplete type

Hi everyone,

i am having a problem with my structs in one of my programs, in my main.c i have that for example :
1
2
3
4
5
6
7
8
9
10
11
if(pch!=NULL){
		    puts(string);
			fseek(fp,size,SEEK_SET);
			fscanf(fp,"%s",var->name);
			fscanf(fp,"%s",var->name);
			check_name(var);
			add_to_list(var,head,tail);
			printf("Name %s \n",var->name);
			printf("Value %d \n",var->value);
			
		}

the problem is at the lines of fscanf and printf at which i get the error : dereferencing pointer to incomplete type

i also have these in my project, (at functions.c)
1
2
3
4
5
6
	
        typedef struct metablith{
		char name[50];
		int value;
		struct metablith *next;
	}metablith;

and
void add_to_list(tdeikth var,tdeikth head,tdeikth tail){....}
and at functions.h :
1
2
3
4
5
typedef struct metablith* tdeikth;

void add_to_list(tdeikth , tdeikth , tdeikth);

void check_name(tdeikth );
What is your intention with: typedef struct metablith* tdeikth;?

Did you intent to create some synonym for struct? Or not? I guess not.

Your next lines won't work because of this either. You declare it as:
void add_to_list(struct , struct , struct); that does not make much sense.
void check_name(struct );

There may be other errors I don't know.
Last edited on
with this typedef struct metablith* tdeikth; i was hoping to create a pointer to type metablith variables, thats why i declare my functions with "tdeikth", to work with pointers.
Last edited on
Topic archived. No new replies allowed.