Multi level hash/dictionary creation in C++ -
I have lost a bit, I have a CSV file like
USN name dob cm Percent 111 ABC 07/03 3 88 112 CD 18/07 4 77 123 G 15/11 4 80
I use a type of type structure (multilingual dictionary using C ++) I want to create code> dictionary & lt; string, dictionary & lt; string, string & gt; & gt; ). Here I want to store the first row as the key ie USN, name, DOB .. In the form of Is it possible to have the keys of the hash and the value of the value hash in that column? Any help would be greatly appreciated .. Thanks in advance.
In view of your question, you will see unordered_map
, which is C ++ 11 is standard and is very common in the previous implementation. If performance is not very important (or really small map) you can also use the map
, then you can:
using namespace std ; Unordered_map & lt; String, unordered_map & lt; String, string & gt; & Gt; Dict; After that, it's a question of parsing your CSV file ...
Comments
Post a Comment