How to make a dictionary equivalent from C# to c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to make a dictionary equivalent from C# to c++

How to make a dictionary equivalent from C# to c++

16th Oct 2020, 5:51 PM
Gizmo-Lang
Gizmo-Lang - avatar
4 Answers
+ 5
#include <map> map<keytype, valuetype> dictname = { {key1, value1}, {key2, value2} };
16th Oct 2020, 6:29 PM
Brian
Brian - avatar
+ 2
If you're looking for a faster method than map, unordered_map will be good; Its time complexity is constant because it uses hashing to store data.
25th Oct 2020, 10:53 AM
Soheil
Soheil - avatar
+ 1
thx
16th Oct 2020, 7:10 PM
Gizmo-Lang
Gizmo-Lang - avatar
0
ok
25th Oct 2020, 11:52 AM
Gizmo-Lang
Gizmo-Lang - avatar