I want to use a non-static object variable as a default method argument
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2159538/c-publicly-inherited-class-member-cannot-be-used-as-default-argument">c++ publicly inherited class member cannot be used as default argument</a><br>
  <a href="http://stackoverflow.com/questions/4539406/nonstatic-member-as-a-default-argument-of-a-nonstatic-member-function">Nonstatic member as a default argument of a nonstatic member function</a>  </p>
</blockquote>



<pre><code>LinkedInteger accessElement(int index, LinkedInteger *startElement=&amp;DataArray[0]){ // Starting at *startElement*, returns the element which is at the index of *startElement+index

    LinkedInteger NullElement;
    if (index&lt;0){
        cout &lt;&lt; "Index degeri sifirdan buyuk olmalidir" &lt;&lt; endl;
        NullElement.value=0;
        NullElement.nextPtr=0;
        return NullElement;
    }       
    for (int i=0; i&lt;index; i++){
        if (startElement-&gt;nextPtr == NULL){ // Last elements index is null.
            cout &lt;&lt; " Erismeye calistiginiz eleman dizi sinirlarinin disindadir " &lt;&lt; endl;
            NullElement.value=0;
            NullElement.nextPtr=0;
            return NullElement;}
        else {
            startElement=startElement-&gt;nextPtr;
        }
    }
    return *startElement; 
}
</code></pre>

<p>This is a method in implementation of Linked Lists in c++, which simply lets access to lists elements
I want to give the header as a default argument (which is indeed DataArray[0]).
It fails because of the error "invalid use of non-static data member".</p>

<pre><code>this-&gt;&amp;DataArray[0]
</code></pre>

<p>also fails because of "this may not be used in this context" What should I do?</p>

<p>Also there are some issues with the context of the code. Please ignore them.</p>
