开发者

Can you have an array of maps in C++?

If so how? Because currently trying to handle input for mu开发者_运维问答ltiple players using a map of actions.


std::vector<std::map<a,b> >

or if you want to handle the construction/destruction yourself

std::vector<std::map<a,b>* >

where a and b are the keys/values in your map

For example:

#include <vector>
#include <map>

int main(int argc, char* argv[])
{
   std::vector<std::map<int,int>> vecOfMaps;
   std::vector<std::map<int,int>*> vecOfMaps2;
   return 0;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜