Accessing another classes member
<p>I have the following</p>

<pre><code>class book
{
    friend class linkedList;
private:
    class student
    {
        friend class book;
        string name;
        string number;
        string gpa;
        student *left;
        student *right;

        student(string name1, string number1, string gpa1,
            student *left1 = NULL, student *right1 = NULL)
        {
            name = name1;
            number = number1;
            gpa = gpa1;
            left = left1;
            right = right1;
        }
    };

    int count;
    student *root;
    ofstream recordBook;

    void _add(student *&amp;, string, string, string);
    void _display_book(student *);
    bool _search_for_name(string, string&amp;, string&amp;);
    bool _edit_entry(string &amp;name, string &amp;edited_number);
    void _del_person(student *&amp;, string);
    void _save(student *root);
    void _del_Tree(student *);

public:
    student *currentRoot;
    book(void); //Constructor
    ~book(void);//Destructor
    void add(string entry_name, string telephone_number, string gpa);
    void display_book();
    bool search_for_name(string find_name);
    bool edit_entry(string entered_name, string edited_number);
    void del_person(string entry_name);
    void save();
    void load_data();
};

class linkedList 
{
    friend class book;
    int someInt;
    struct node 
    {
    public:
        string key;
        node *link;
        node *link2;
    } *pointer;
public:
    student book::*currentRoot = &amp;book::currentRoot;
    linkedList();
    ~linkedList();
    void append(string &amp;str);
    void del(string &amp;str);
    void display();
};
</code></pre>

<p>And I need to make a pointer to "student *currentRoot" from my linkedList classes function. </p>

<pre><code>void linkedList::append(string &amp;str)
{
    node *q, *t;
    if(pointer == NULL)
    {

        pointer = new node;
        pointer-&gt;key = str;
        pointer-&gt;link = NULL;
        pointer-&gt;link2 = currentRoot;
        someInt += 1;
    }
    else
    {
        q = pointer;
        while(q-&gt;link != NULL)
        {
            q = q-&gt;link;
        }
        t = new node;
        t-&gt;key = str;
        t-&gt;link = NULL;
        q-&gt;link = t;
        someInt += 1;
    }
}
</code></pre>

<p>In linkedList::append I need to make link2 point to where currentRoot is pointing to. How can I do this? (currentRoot is already set to point at a node in a binary tree. Just gotta get my hash table to also point there.) Thanks for any help.</p>
