本文介绍了C++ 中的 4d 映射?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你能告诉我如何写多维地图吗?对于二维地图,我做了以下事情:

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;

我试图使用类似于以下内容的 4d 映射.

I was trying to use something similar to following for 4d mapping.

map<string, string, string, int> Employees;
Employees["person1"]["gender"]["age"] = 200;

你能告诉我正确的方法吗?

Can you please tell me the correct way to do this?

推荐答案

map<string, map<string, map<string, int> > > employees;
employees["person1"]["gender"]["age"] = 200;

这篇关于C++ 中的 4d 映射?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 23:01