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.

a) is correct ans
what’s your doubt in it??

pair is a inbuilt class which is used to store 2 things

inside a pair you can also store another pair

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.