What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-02-28 05:55:16
append string c++
// appending to string #include <iostream> #include <string> int main () { std::string str; std::string str2="Writing "; std::string str3="print 10 and then 5 more"; // used in the same order as described above: ... Add solution -
C++ 2022-02-25 04:00:07
loop through set c++
// set::begin/end #include <iostream> #include <set> int main () { int myints[] = {75,23,65,42,13}; std::set<int> myset (myints,myints+5); std::cout << "myset contains:"; for (std::set<int>::iterator it=my... Add solution -
C++ 2022-02-24 11:00:27
get index of value c++
vector<int> arr = { 6, 3, 5, 2, 8 }; vector<int>::iterator itr = std::find(arr.begin(), arr.end(), elem); if (itr != end(arr)) { cout << "Element " << elem << " is present at index " << distance(ar... Add solution