'<<name of method>>' was not declared in this scope
<p>I want to independently overload <code>operator+</code> to concatenate 2 double chained lists. My idea is to obtain the address of the first element from the first list and the address of the first element from the second list. </p>

<p>In <code>DoubleChainedList</code> class, except the constructor, destructor and the next 4 methods which are working fine, I made a method called <code>get_prim</code> which is supposed to get me the address of the first element from the specified list. Then, using the method <code>get_current</code> I want to move through the first list until it ends while adding in the third list the elements, and then apply the same principle to the second list. </p>

<p>But I have a problem, I get</p>

<pre><code>'get_prim' was not declared in this scope
</code></pre>

<p>and </p>

<pre><code>'get_current' was not declared in this scope
</code></pre>

<p>at the bolded tagged lines (see the code below) when I compile. What am I missing?</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;stdlib.h&gt;
using namespace std;

//Create node class
class Node
{
private:
    float value;         
    Node *back;        
    Node *next;       
public:
    Node *set_value (Node *x, float element) { x-&gt;value=element; return x; }
    float get_value (Node *x) { return x-&gt;value; }
    Node *set_back (Node *x) { return x-&gt;back; }
    Node *set_next (Node *x) { return x-&gt;next; }
    Node *set_back_nod (Node *x, Node *y) { x-&gt;back=y; return x; }
    Node *set_next_nod (Node *x, Node *y) { x-&gt;next=y; return x; }
    void next_to_2next (Node *x) { x-&gt;next=x-&gt;next-&gt;next; }
    void next_back_to_origins (Node *x) { x-&gt;next-&gt;back=x; }
};

//Create list class
class DoubleChainedList : public Node
{
private:
    Node *prim;       
    Node *ultim;    
public:
    DoubleChainedList() { prim=NULL; ultim=prim; }           //Constructor
    ~DoubleChainedList();                                    //Destructor
    void insert_back(float element);                         //Inserts an element at the end of the list
    void delete_element_from_position(int delete_position);  //Deletes from the list the element whose position is equal to "delete_position"
    void show_left_right();                                  //Shows the list from the first element to the last one
    void show_right_left();                                  //Shows the list from the last element to the first one
    Nod *get_prim (DoubleChainedList myList) { return this-&gt;prim; };    //Intended to obtain the address of the first element from "myList"
    Nod *get_current (Node *x) { return set_next(x); };                  //Intended to move me through the list
};

DoubleChainedList operator+ (DoubleChainedList myList1, DoubleChainedList myList2)
{
    DoubleChainedList myList3;
    Nod *current1,*current2;
    current1=get_prim(myList1); // ERROR OVER HERE!
    current2=get_prim(myList2);
    cout&lt;&lt;get_value(current1)&lt;&lt;" "; // ERROR OVER HERE!
    cout&lt;&lt;get_value(current2)&lt;&lt;" ";
    return myList3;
}

int main()
{
    int i,number_elem_myList1,number_elem_myList2,element;
    DoubleChainedList myList1,myList2,myList3;
    cin&gt;&gt;number_elem_myList1;
    for (i=0;i&lt;number_elem_myList1;i++)
    {
        cin&gt;&gt;element;
        myList1.insert_back(element);
    }
    cin&gt;&gt;number_elem_myList2;
    for (i=0;i&lt;number_elem_myList2;i++)
    {
        cin&gt;&gt;element;
        myList2.insert_back(element);
    }
    myList3=myList1+myList2;
    return 0;
}
</code></pre>
