1

In Python we can do this, since we can have both int and dict data type values

dict1 = {'a':1, 'b':2, 'c':{'x':3, 'y':3, 'z':5}, 'q':3}

Is there a way to do this in C++ for maps?

3
  • 3
    Does this answer your question? C++ std::map holding ANY type of value Commented Apr 8, 2020 at 5:31
  • 2
    Many other dupes: 1, 2, 3, 4 Commented Apr 8, 2020 at 5:32
  • 1
    I guess it does. Thanks. Commented Apr 8, 2020 at 6:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.