roya_borhany
دوشنبه 12 بهمن 1388, 22:49 عصر
برنامه ی من در بخش اضافه کردن روی خط مشخص شده خطای cannot convert *void to *machin را میدهد. ممنون می شوم راهنمایی کنید
void add(struct machine m)
{
x=malloc(sizeof(m));
if(start==NULL)
{
start=x;
y=x;
}
else
{
y->next=x;
y=x;
}
printf("\nenter machine's type:");
scanf("%s",x->type);
printf("\nenter machine's color:");
scanf("%s",x->color);
printf("\nenter machine's model:");
scanf("%d",&x->model);
printf("\nenter machine's capacity:");
scanf("%d",&x->capacity);
printf("\nenter machine's price:");
scanf("%d",&x->price);
printf("\nenter machine's plaq:");
scanf("%s",x->plaq);
y->next=NULL;
}
void add(struct machine m)
{
x=malloc(sizeof(m));
if(start==NULL)
{
start=x;
y=x;
}
else
{
y->next=x;
y=x;
}
printf("\nenter machine's type:");
scanf("%s",x->type);
printf("\nenter machine's color:");
scanf("%s",x->color);
printf("\nenter machine's model:");
scanf("%d",&x->model);
printf("\nenter machine's capacity:");
scanf("%d",&x->capacity);
printf("\nenter machine's price:");
scanf("%d",&x->price);
printf("\nenter machine's plaq:");
scanf("%s",x->plaq);
y->next=NULL;
}