EmbLogic's Blog

problem in void**data field of the struct scull_Qset

i have checked in general that if we take
void* data; and then do data=(char*)malloc(sizeof(char)); then it gives no warning
but if we take void** data; and then i do
data=(char**)malloc(sizeof(char*));
then it gives a warning of incompatible pointer assignment…..help required here plzz post if anybody knows why

2 Responses to problem in void**data field of the struct scull_Qset

  1. Manoj says:

    Yes bro… I just saw it… thnx for arising such a prob…

    • Neeraj says:

      malloc always return the pointer of void* type and here you are trying to replace the void * pointer to char ** which is wronge as its pointer to a char * pointer

Leave a Reply to Manoj Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>