About 7,260,000 results
Open links in new tab
  1. Map like structure in C: use int and struct to determine a value

    I used to code in C++ and now I try to program in C. Assume I have defined a struct struct point{ int x; int y; } Is there any data structure A in c that can support the following functio...

  2. c++ - How do you loop through a std::map? - Stack Overflow

    14 The value_type of a map is a pair containing the key and value as it's first and second member, respectively.

  3. How to find if a given key exists in a std::map - Stack Overflow

    To those who are looking for speed: count and find are nearly identical in speed when using maps that require unique keys. (1) If you don't need the elements to maintain a specific order, use …

  4. hashmap - C map data structure - Stack Overflow

    Jan 16, 2017 · I want to implement a key value pair data structure in C. Any idea?

  5. insert vs emplace vs operator [] in c++ map - Stack Overflow

    362 In the particular case of a map, the old options were only two: operator[] and insert (different flavors of insert). So, I will start explaining those. The operator[] is a find-or-add operator. It will …

  6. What happens if I read a map's value where the key does not exist?

    Apr 12, 2012 · The map::operator[] searches the data structure for a value corresponding to the given key, and returns a reference to it. If it can't find one it transparently creates a default …

  7. C++ map insertion and lookup performance and storage overhead

    The C++ STL library has a map class for associative arrays of this sort. I have several questions about map. What is the storage overhead of map for a dataset of the size mentioned above? …

  8. Implications of using "auto" to iterate over a C++ std::map data …

    We can use auto keyword when we are not sure about type of variable we are going to work on and can be used to iterate over a map, list using an auto variable or iterator in which we didn't …

  9. How can I print out C++ map values? - Stack Overflow

    map<string ,string> :: iterator it; and after that print it out by looping over the map using iterator from myMap.begin() to myMap.end() and print out key and value pairs in the map with it->first …

  10. Porting std::map to C? - Stack Overflow

    There is no standard library in C that provides functionality analogous to a map. You will need to implement your own map-like functionality using some form of container that supports …