I have a C program that produces an error:
invalid conversion from \'void*\' to \'node*\' [-fpermissive]
Here\'s my code:
You're having this warning/error because you are using malloc (which returns a void*)to initialize a structure of type node* without doing an explicit cast.
To get rid of this error you could change your code this way :
head = (struct node *)malloc(sizeof(struct node));
or you could as well add the "-fpermissive" flag to your compiler which will then ignore these errors.
EDIT: But yeah, i didn't think about the fact that this should not happen in a C compiler anyways