A better approach to storing data in c++ with this format

99 Views Asked by At

So I come from Python and still very new with c++. I would like to do a similar dictionary structure like this in c++

dataDict = { 1:('value 1', 'value 2',...), 2:('value 1', 'value 2',...) }

Usage: I plan on accesing them using their keys and edit/update their values if necessary. Does using a map possible or a multidimensional array?

1

There are 1 best solutions below

2
Jens Munk On

You can use a

std::map<std::string, T>

where T is the type of the data you want to store in the dictionary