Hello there everyone,
While I was implementing set I found a quite weird output, as sets store data in sorted order, I am passing greater sort. I inserted a few data and I got an output which was unexpected I am attaching that here
Where are you printing -3 ?? I can’t see a print statement.
Set stores at different address. “it” itself is a pointer/iterator. You should print “it” to see the address of the set’s element. &it refers to the location of “it” in the memory which is always constant as it is a pointer/iterator,