October 29th, 2002, 01:11 AM
|
#1 (permalink)
|
| Senior Member
Join Date: Oct 2001 Location: Eastern Shore
Posts: 701
|
Alright, let me try to explain things as clearly as possible.
I have created two classes, one is a Node class and the other is a set class. Now the set class is composed of Nodes, however, there is NOT any inheritance. (Creating a pointer-based linked list).
The Node member has only two data types, int dataValue (the data for that Node) and Node *next (a pointer to the next Node in the list).
Anywho, what I am trying to do is create a local function in the Set class that returns a Node. Can not seem to get the syntax correct though. Here is what I have so far Code: Node *current;
current=(head,members);
//head is the first member of the list, members is the number of members in the list
Node findLast(Node *pointer, int members)
{
int i=1;
while(i<members)
{
pointer=pointer->next;
i++;
}
return pointer;
} Very simple and straightforward function, the return is just killing me. Anyways, thanks you all.
ILC |
| |