M
mohi
hello everyone ,
as i have noted a lot many times it has been mentioned that we shudn't
cast pointers returned by malloc()
i mean
its been said that use
node * nod=malloc(sizeof(node));
instead of
node * nod=(node *) malloc( sizeof(node));
but when i use the upper way my gcc compiler shows error like
invalid conversion from void* to node*
whats the matter ?
pls help
thank you
mohan
as i have noted a lot many times it has been mentioned that we shudn't
cast pointers returned by malloc()
i mean
its been said that use
node * nod=malloc(sizeof(node));
instead of
node * nod=(node *) malloc( sizeof(node));
but when i use the upper way my gcc compiler shows error like
invalid conversion from void* to node*
whats the matter ?
pls help
thank you
mohan