Hey Similar doubt. Hers is the code snippet..
typedef struct
{ char v;
struct node *next;
}node;
void make_it(node a, char ch);
int main()
{ int i,n=10;
char ch[2];
node *a=(node *)malloc(n*sizeof(node));
a[i].v=i+65;
a[i].next=NULL;
scanf("%s",ch);
make_it(a[i],ch[0]);
return 0;
}
void make_it(node a, char c)
{ node *ptr,*p;
ptr=(node *)malloc(sizeof(node));
ptr->v=c;
ptr->next=NULL;
*p=a;
while(p->next!=NULL)
{ p=p->next; // gives warning on this line.
}
p->next=ptr; // warning here too..
}
Can some1 tell me what can be the reason?