title: Why scope resolution necessary for struct define inside a class when returning as value?
body: <p>I have a singly linked list implementation as shown below:</p>
  
  <p><strong>Header</strong></p>
  
  <pre><code>class SinglyLinkedList
  {
    struct Node
    {
      Node * _pNext;
      int    _data;
    };
  
  public:
  
    Node * SomeFun(Node * ip1, Node * ip2);  
    // Some more methods here
  };
  </code></pre>
  
  <p>Now when implementing one of the methods of this class</p>
  
  <p><strong>CPP</strong></p>
  
  <pre><code>Node * SinglyLinkedList::SomeFun(Node * ip1, Node * ip2)
  {
    //Some code and return
  }
  </code></pre>
  
  <p>The strange behavior I am not understanding is that when compiling, the compiler
  refuses to recognize the type "Node" in the return type unless I specify it as 
  <strong><em>SinglyLinkedList::Node</em></strong>. But the same type for function arguments is recognized
  without specifying it explicitly.. Ideally I felt that in both cases there should be
  no need for this explicit specifying because Node is defined in the same class.
  Can anyone throw some light on this?</p>