jbeder / yaml-cpp

A YAML parser and emitter in C++
MIT License
5.09k stars 1.83k forks source link

terminate called after throwing an instance of 'YAML::BadSubscript' #1190

Closed puerteee closed 1 year ago

puerteee commented 1 year ago

I wrote a C++program to read the parameters in the yaml file and successfully compiled it. At runtime, I was prompted with the following information: terminate called after throwing an instance of 'YAML::BadSubscript' what( ): oprator[ ] call on a scalar (key:"0") I hope someone can answer the reason for the problem. If you can provide a solution, it would be even better. Thank you!

nickk-dv commented 1 year ago

You can review all the exeptions in yaml-cpp/exceptions.h I guess that strings like "0" are not valid keys in this library.

jbeder commented 1 year ago

In any case, please ask questions like this on Stack Overflow and tag it yaml-cpp.