Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ set element at index

std::set<int> my_set;
//inserting element in set
my_set.insert(5);
my_set.insert(15);
my_set.insert(10);
my_set.insert(7);

//accessing nth element form set
int x = *std::next(my_set.begin(), n);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #element #index
ADD COMMENT
Topic
Name
2+1 =