Can a vector class in C++ be used like a Dictionary class in C#? -


can vector class in c++ used dictionary class in c#? can have vector class store classes of same type. member of class can regarded key , remaining members can thought of data.

no, vector class in general won't stay sorted when add members. means can't efficiently find items in it, need linear scan.

use std::unordered_map key-value container offer o(1) key lookup.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -