Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

follow your nodes

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
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 return
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.

Name: Anonymous 2010-04-28 19:39

node my anus

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List