typecasting of pointers - Programmers Heaven

Howdy, Stranger!

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

Categories

typecasting of pointers

arunabhaarunabha Posts: 1Member
#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.