I'm creating a *Node inside a function (allocate and accessing its members) but when I try to access compiler jumps.
l've tried this (Node*)(*_node)->item = ""; but it says "suspicious pointer conversion".
Thanks in advance.
Code:
int main (int argc, char* argv[]) {
Node *node;
// allocate new node
initialize(&node);
// print node
if (!strlen(_node->item) )
printf("[null, ");
else
printf("[%s, ", _node->item);
if (!_node->next)
printf("null]\n");
else
printf("*node]\n");
return 0;
}
void initialize(Node **_node) {
*_node = malloc( sizeof(Node));
//how to l access to _node members???
// _node->item = ""
// _node->next = NULL;
}