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?

You failed to give your structure a name. A typedef identifier is not the same as a structure tag, but you can use the same identifier for both because they're in different name spaces:

typedef struct node
{	char v;
	struct node *next;
}node;

This produces the usual C++ behavior:

struct node x; /* OK */
node x; /* Also OK */
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.