Sir doubt in set

sir my doubt is if suppose there is set of pair of int,int
and we use s.upper_bound() function what will this function return??

Hey @tejasddongare
upper_bound(): It returns an iterator pointing to the first element in the range [first, last) which has a value greater than the given value “val” . But in set/vector of Pairs upper_bound() for pair(x, y) will return an iterator pointing to the position of pair whose the first value is greater than x and second value is greater than y .
If the above-mentioned criteria are not met, then it returns an iterator to the index which out of the set/vectors of pairs.

if it is returning the iteration why are we using arrow that is -> to access the firsf and second element?

sir i have head this time alot of time what exactly iterator means??

Iterators are used to point at the memory addresses of STL containers. They are primarily used in sequence of numbers, characters etc. They reduce the complexity and execution time of program.

For simplicity, you can consider them as pointer to containers but they are more than that.

Now talking about ->
Say we have a class node and we have created its object dynamically say
node* obj=new obj();
now to print its value you use obj->data;
Similarly here the returned iterator points to the pair and to print it we use it->first and it->second.