I've never seen something like:
How do I use the Remove function if I'm instantiating an instance like this:Code:class IdClass { public: IdClass(); // initialize the list ~IdClass(); // de-allocate the list void Add (void *item, int Key); // Put item into list void *Remove (int Key); private: IdElement *first; // Head of the list, NULL if list is empty IdElement *last; // Last element of list }; void * IdClass::Remove (int a) { IdElement * tmp = first, * prev = (IdElement *)NULL; while ((tmp != NULL) && (tmp->key != a)) { prev = tmp; tmp = tmp->next; } //more code in function here return value; }
I don't know how to call Remove. I've never seen that syntax before. And what does that syntax mean?Code:IdClass *test; test = new IdClass(); //for add I can do this test->Add(itemptr,5);



LinkBack URL
About LinkBacks


