0

I am tried to know about yaml rules.
And init.yaml file is like this:

name: Ryan Braun
position: LF

Main code:

int main()
{
    YAML::Node node = YAML::LoadFile("init.yaml");
    cout << node.Type() << endl;
   return 0;
}  

This was just a simple example, I want to see my node's type. This should a map as described in How To Emit YAML. But the output is 0, which means is Undefined. That makes me confused. Maybe I misunderstand.
Any suggestions will be thankful.

crazymumu
  • 101
  • 2
  • 10
  • Does it work when you do this instead: `YAML::Load("name: Ryan Braun\nposition: LF");` ? – flyx Aug 19 '17 at 09:15
  • @flyx, I got **what(): yaml-cpp: error at line 0, column 0: bad file** tried with your suggestion. – crazymumu Aug 20 '17 at 02:10
  • This hints to some serious problem with yaml-cpp in your environment, as loading a string should definitely work and the fact that it gives a *bad file* error shows that something very strange is going on. Unfortunately, I have not enough knowledge about yaml-cpp to help you at this point. – flyx Aug 21 '17 at 19:53

0 Answers0