so I am having weird problems trying to create a node with this struct:
struct node {
char *value ;
unsigned int count ;
struct node *next ;
} ;
here's what i've got
struct node *make_node(char *value) {
struct node *np = NULL;
*np = (*np)malloc(sizeof(*np));
char* copy = (char*)malloc(sizeof(strlen(value)+1));
strcpy(copy, *value);
*np -> *value = copy;
*np -> count = 1;
*np -> next = null;
return np ;
}
the string part is throwing me i think. I'm getting a bunch of incompatable pointer types.
--EDIT-- Answered, thank you all for helpin me