I have a struct defined as private in a class list and I want to pass a pointer to one of my structs to one of my functions. This is my struct in my LinkedList class:
1 2 3 4 5 6 7 8 9 10 11 12 13
class LinkedList{
private:
struct ListNode
{
/** A data item on the list. */
String item;
/** Pointer to next node. */
ListNode *next;
ListNode *prev;
}; // end ListNode
};
I want to (in a different class) create a function that takes in a string to be added and a pointer to the first node in my list. Something like this:
1 2
void insert(const string myString, POINTER TO FIRST NODE IN LIST){
}
What do I put in that second part of the parameter so that I can have a pointer to the "head" of my list?