Horje
map declaration c++ Code Example
map declaration c++
//assuming your variables are called : variables_
#include <map>
#include <string>

std::map<int, std::string> map_;
map_[1] = "mercury";
map_[2] = "mars";
map_.insert(std::make_pair(3, "earth"));
//either synthax works to declare a new entry

return map_[2]; //here, map_[2] will return "mars"




Cpp

Related
c++ vector average Code Example c++ vector average Code Example
std distance Code Example std distance Code Example
int main() { Code Example int main() { Code Example
insert element in array c++ Code Example insert element in array c++ Code Example
what is a variable in cpp Code Example what is a variable in cpp Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10