typecasting of pointers

#include
#include
struct node
{
int data;
struct node *next;
};
struct node **tos;
void main()
{
struct node *head,*new;
struct node *p=NULL;
tos=&p;
head=(struct node*)malloc(sizeof(struct node));
head->data=10;
head->next=tos;
new=(struct node*)malloc(sizeof(struct node));
tos=new;
printf("%d",head->data);
getch();
}
it gives a warning on line no-16&18:
warning :suspicious pointer conversion
please crrect and explain?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories