Algorithm stl related

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.

How 1st option is right ?

hello @Akashuni
lets note what all values we want to store

  1. string
  2. int
  3. double
  4. int *

now if u see carefully only first option is contianing these datatype thats why it is correct

right?

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.