#include <stdio.h>
#include <stdlib.h>
typedef struct node {
int value;
struct node *next;
}LLIST;
LLIST *list_add(LLIST **p, int i)
{
if (p == NULL)
return NULL;
LLIST *first = malloc(sizeof(LLIST));
if (first == NULL)
return NULL;
first->value = *first;
*p = first;
first->value = i;
}
int main (int argc, char** argv) {
int i=0;
LLIST *first = NULL;
list_add(&first, 0);
return (EXIT_SUCCESS);
}
Giving me errors like
IntelliSense: a value of type "void *" cannot be used to initialize an entity of type "LLIST *"
at the malloc line in list_add can you help me ??? when i am typing the code no errors are showing up intellisense is helping me to build the node code... but when compile this coming this ... can you help me how to fix it ?