What do you want to save?
Add Code snippet
New code examples in category C++
-
Lizzie 2021-09-03 02:27:01
c++ string on multiple lines
std::string firstWay = "This text is pretty long, but will be " "concatenated into just a single string. " "The disadvantage is that you have to quote " "each part, and newlines must be literal as " "... Add solution -
Rob F 2021-09-03 02:01:02
error: 'std::high_resolution_clock' has not been declared
#include <chrono> using std::chrono::high_resolution_clock; using std::chrono::microseconds; using std::chrono::duration_cast; auto start = high_resolution_clock::now(); rd(n); auto stop = high_resolution_clock::now(); auto duration = duration_cast... Add solution -
Rrr Ppp 2021-09-02 17:09:01
variadic templates
template<class... Args> void Foo(Agrs*... arguments); template<class... Args> class A; /* Variadic templates can be used to allow a multitude of variations of a class or function to be compiled without having to explicitly state what the req... Add solution -
Kisser 2021-09-02 10:56:02
c++ program how to let the user choose different game modes
int getMode(int *virus, int *frequency, int numVir) { int count = 0, index = 0, mode = 0, frLow = 0, total = 0; for (index = 0; index < numVir; index++) { count = 1; while (*(virus + index) == *(virus + index + 1... Add solution -
Swilcox 2021-09-01 09:10:02
vector c++
// CPP program to create an empty vector // and push values one by one. #include <vector> using namespace std; int main() { // Create an empty vector vector<int> vect; &n... Add solution
Best helpers
Aniruddha
+5
Bdforbes
+5
Sohail
+5
Styler
+5
Rupali
+5
Lizzie
+5
Matt Montag
+5
Happypassage
+5
Amirhossein
+5
Voldemort
+5
Suriyan
+5
EdwardT
+5