What do you want to save?
Add Code snippet
New code examples
-
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 -
C++ 2022-02-23 04:00:07
pure virtual function in c++
#include <iostream> #include <string> //Pure virtual function or inteface allows us to define a function in a base class that doesn't have an implementation or definition in the base class and force sub classes to implement that function //P... Add solution -
C++ 2022-02-22 16:50:05
quicksort in code
// A full c++ quicksort algorithm no bs // quicksort in code #include <iostream> using namespace std; void QuickSort(int arr[], int start, int end); int Partition(int arr[], int start, int end); void SwapArrMem(int arr[], int a, int b); int main... Add solution