Is there a way to convert a hash made in ruby to a C++ map? I’ve tried printing the hash into a file, but am unaware of how to read it into a C++ map.
The hash is printed in the following way:
stringA => 123 234 345 456 567
stringB => 12 54 103 313 567 2340
...
The amount of numbers varies for each associated string, and the strings are unique. I would like to use:
std::map<std::string,std::vector<unsigned int>> stringMap;
How can I read the string and array parts of each line separately?
Just use plain-Jane formatted input: