Quantcast
Channel: Converting a python dictionary to cpp object - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Converting a python dictionary to cpp object

$
0
0

I have to convert a python object to c++ but I have no idea about python. The object looks like this:

VDIG = {    1024 : [1,2,3,4],    2048 : [5,6,7,8]}

From the look of it I think it might be a map of lists?

What is the closes object that can be used in c++ ?

I tried to do like this but it does not compile:

std::map<int, std::list<int>> G_Calib_VoltageDigits = {    1024 {1,2,3},    2048 {4, 5, 6}};

So my question is what is that data type in Python called and what is the best way to have a similar thing in c++?


Viewing all articles
Browse latest Browse all 2


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>