What do you want to save?
Add Code snippet
New code examples
-
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 -
C++ 2022-02-21 17:55:12
c++ set add element
// set::insert (C++98) #include <iostream> #include <set> int main () { std::set<int> myset; std::set<int>::iterator it; std::pair<std::set<int>::iterator,bool> ret; // set some initial values: for (int i=1;... Add solution -
C++ 2022-02-20 20:45:02
undefined reference to instance
//Put this in the .cpp Singleton *Singleton::instance = NULL; //! This is the Singleton definition in .hpp class Singleton { private: static Singleton *instance; public: static Singleton *getInstance() { if (instance == NULL) {instance = new S... Add solution -
C++ 2022-02-19 11:45:06
how to find quotient and remainder in c++
#include <iostream> using namespace std; int main() { int divisor, dividend, quotient, remainder; cout<< "Enter dividend: "; cin>> dividend; cout<< "divisor: "; cin>> divisor; ... Add solution -
C++ 2022-02-18 01:25:19
reverse string efficient in cpp without using function
#include <iostream> using namespace std; int main() { char str[] = "Reverseme"; char reverse[50]; int i=-1; int j=0; /*Count the length, until it each at the end of string.*/ while(str[++i]!='\0'); ... Add solution -
C++ 2022-02-17 22:35:05
yearly interest calculator c++ using for loop
#include <iostream> #include <cmath> #include <iomanip> using namespace std; void main() { // Inputs // double princ = 0.0; double rate = 0.0; int years = 0; int year = 1; double total = 0.0; // Ask User For INFO // cout << &qu... Add solution -
C++ 2022-02-17 10:35:04
loop over multidimensional array c++
int arr[2][3] = { {1,2,3}, {4,5,6} }; for(int i=0 ; i<sizeof(arr) / sizeof(arr[0]) ; i++){ for(int j=0 ; j<sizeof(arr[i])/sizeof(arr[i][0]) ; j++){ cout<<"2D array have: "<< arr[i][j]<<endl; } } Add solution