Finding the datatype

How to approach this type of problem??
We wish to design a data type that can be used to hold a string, an integer, a double and a pointer to an integer.

Which of the following can be used as an alternative to above required data type.

typedef pair< string, pair< int, pair< double, int * > > > myDataType

typedef pair< string, pair< int, pair< int, int * > > > myDataType;

typedef pair< string, pair< int*, double > > myDataType;

None of these.

1 Like

is this a question you have a doubt in or a quiz? idrk the answer, but you could create a poll for better thingy

  • option 1

0 voters

  • option 2

0 voters

  • option 3

0 voters

  • option4

0 voters

i just clicked to see who voted and it just marked my answer…:flushed: is it correct tho?

I don’t have the faintest idea, also i can’t edit a poll after the first five minutes, so your answers are public :o:

i was just doing practice and found this one, i have no idea how to approach this one.

answer to the question is (b)

Instead of using such a confusing data type with nested pairs, why not just define a new struct?