how he declared an array like this
pair<string,int> emp[100005]
can u explain this type of declaration
Sanjays new job question
@sktg99 This is an array of pairs and an array of pair can be declared like this. There is no point to explain in this. Just as you declare other variables like int a, int arr[100], it is just like that.
In int arr[100]–> each index in array will contain a data of int type.
In pair<string,int> emp[100005] —> each index of array emp will contain a data of pair type.
In case you are not familiar with pair:
The pair container in C++ STL is a simple container consisting of two data elements or objects.Pair is used to combine together two values which may be different in type. Pair provides a way to store two heterogeneous objects as a single unit.