Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to get last element of set in c++

set<int> s = {1,2,3}
auto it = s.end();
it--;
cout<<*it<<"
"; // This refers to last element of a set
 
PREVIOUS NEXT
Tagged: #element #set
ADD COMMENT
Topic
Name
7+5 =