Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

access last element of set c++

auto it = s.end();
it--;
cout<<*it<<"
"; 
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ how to return an empty vector 
Cpp :: how to replace part of string with new string c++ 
Cpp :: read string with spaces in c++ 
Cpp :: c++ template 
Cpp :: c ++ split_string 
Cpp :: heap buffer overflow in c 
Cpp :: tuple vector c++ 
Cpp :: why do we use pointers in c++ 
Cpp :: exponent of x using c c++ 
Cpp :: c++ forbids comparison between pointer and integer 
Cpp :: C++ Calculating the Mode of a Sorted Array 
Cpp :: c++ loop trhought object 
Cpp :: how to make a vector in c++ 
Cpp :: c++ string_t to string 
Cpp :: C++ program to sizes of data types 
Cpp :: c++ unittest in ros 
Cpp :: find the graph is minimal spanig tree or not 
Cpp :: . Write a C++ program to calculate area of a Triangle 
Cpp :: read a whole line from the input 
Cpp :: c++ split string 
Cpp :: maximum subarray leetcode c++ 
Cpp :: c++ lambda as variable 
Cpp :: what algorithm does bitcoin use 
Cpp :: if not c++ 
Cpp :: invert a binary tree 
Cpp :: c++ function overloading 
Cpp :: c++ string example 
Cpp :: cuda shared array 
Cpp :: function for reversing an array c++ stl 
Cpp :: c++ friend keyword 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =