struct mystruct_type {
int a;
int b;
};
typedef struct mystruct_type mystruct;
void function1
{
mystruct place[N],*temp1,*temp2,*temp3;
temp1= malloc(sizeof(mystruct));
temp2= malloc(sizeof(mystruct));
temp1->a=3; temp1->b=4;
assign(temp2,temp1);
temp3=add(place,place+2);//Want to add mystruct[0]+mystruct[2],2+4,4+6....loop not shown here
}
void assign (mystruct * m1,mystruct * m2)//Gives warning conflicting types for assign
{
m1->a=m2->a;
m1->b=m2->b;
}
mystruct * add (mystruct * m1, mystruct * m2)//Error: Conflicting types for add
{
complex * c;
c=malloc(sizeof(mystruct));
c->a=m1->a+m2->a;
c->b=m1->b+m2->b;
return c;
}
Can anybody point whats the mistake?
Thanks....