Can you please tell me how I can write multidimensional map. For two dimensional map, I did the following:
map<string, int> Employees
Employees[“person1”] = 200;
I was trying to use something similar to following for 3d mapping.
map<string, string, int> Employees;
Employees[“person1”, “age”] = 200;
Can you please tell me the correct way to do this?
and Is there a way I can initialize all the map elements to be 0 ? Just like on a array we can say int array[10]={0};
3D mapping technology uses machine vision to aid in profiling objects in three dimensions to map them in the real world, providing the latest technical methods for visualisation and information acquisition. 3D mapping requires the profiling of objects in three dimensions to map those objects in the real world.
You cannot have three elements. The STL map stores a key-value pair. You need to decide on what you are going to use as a key.
What is a map in C++? A C++ map is a way to store a key-value pair. A map can be declared as follows: #include <iostream> #include <map> map<int, int> sample_map; Each map entry consists of a pair: a key and a value.
You need to create map of maps like that.
map<string, map<string, int> > employees;
employees["person1"]["age"] = 200;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With