Name: Anonymous 2010-04-28 14:19
Working on a C++ class function that has to return a pointer to a new_node. The function is
Class is "List", function defined as
Node was defined in List.h, and this function is in List.cpp (essentially a class for basic linked list stuff).
My last experience was just creating something like this without using classes, so I'm pretty new to this and not sure what I should be doing here. Fruit loops for any input.
struct node* List::createNode(int i){
struct node* new_node = new struct node;
new_node->data = i;
return new_node;
}Class is "List", function defined as
struct node* createNode(int i);, and I get this error cannot convert List::node* to node* in returnNode was defined in List.h, and this function is in List.cpp (essentially a class for basic linked list stuff).
My last experience was just creating something like this without using classes, so I'm pretty new to this and not sure what I should be doing here. Fruit loops for any input.