title: Parsing yaml file using yaml-cpp new API - Issue Fixed
body: <p>I am using yaml-cpp 0.6 latest to parse an yaml file.</p>
  
  <p>my yaml file looks like this,</p>
  
  <pre><code>-person: p1
   obj: 
     name: x
     age: 27
  -person: p2
   obj:
     name: y
     age:38
  </code></pre>
  
  <p>my code,</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;yaml-cpp/yaml.h&gt;
  using namespace std;
  int main()
  {
      YAML::Node config = YAML::LoadFile("config.yaml");
      if(config.IsNull())
      {
          cout &lt;&lt; "return";
      }
  
      cout &lt;&lt; "size: " &lt;&lt; config.size() &lt;&lt; endl;
      for(YAML::iterator it = config.begin(); it != config.end(); ++it)
      {
          YAML::Node node = *it;
          cout &lt;&lt; "node size: " &lt;&lt; node.size() &lt;&lt; endl;
          //for(YAML::iterator it2 = node.begin(); it2!=node.end(); ++it2) {}
          //iterating over node throws seg fault
          cout &lt;&lt; node &lt;&lt; endl;
          cout &lt;&lt; "-----" &lt;&lt; endl;
      }
      return 0;
  }
  </code></pre>
  
  <p>The o/p I see is,</p>
  
  <pre><code>return
  size: 2
  node size: 2
  node size: 2
  
  obj:
    name: x
    age: 27
  person: p1
  2
  -----
  person: p2
  obj:
    age: 38
    name: y
  </code></pre>
  
  <p>Please help me understand why the root node, config is Null in my case though its size returns 2.
  Also if config though Null is iterable, why not node then?
  Iterating over node throws seg fault and so commented.
  How to iterate over node to list persons in my case and read each person's attribute?
  How to get name, age.. using something like node["person"]["name"] ?</p>
  
  <p>Its a mistake from my side. Not sure, if it is because of the wrong installation of libyaml-cpp... It started working once, removed and reinstalled the libyaml-cpp0.5/libyaml-cpp-dev.
  Thanks!</p>