What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-02-01 04:50:46
matrix multipliction in c++
#include <iostream> using namespace std; int main() { int a[10][10], b[10][10], mult[10][10], r1, c1, r2, c2, i, j, k; cout << "Enter rows and columns for first matrix: "; cin >> r1 >> c1; cout << ... Add solution -
C++ 2022-01-31 21:17:58
how to delete an element in vector pair in cpp
#include <iostream> #include <utility> #include <vector> using namespace std; int main() { vector< pair<int, int> > v; int N = 5; const int threshold = 2; for(int i = 0; i < N; ++i) v.push_back(m... Add solution -
C++ 2022-01-31 18:27:39
what is -> in c++
/** * @author Charles Salvia (StackOverflow) * * -> is to access a member function or member variable of an object through * a pointer, as opposed to a regular variable or reference. */ // For example: with a regular variable or reference, you us... Add solution -
Other 2022-01-31 09:47:24
find is number prime
int number; cin >> number; if (number == 2) { cout << "Prime" << endl; return; }else if(number == 1 || number % 2 == 0){ cout << "Not prime" << endl; return; } for (int i = 3; i * i <= number; i+=2)... Add solution -
C++ 2022-01-31 09:41:28
c++ smart pointer 2d array
#include <iostream> #include <memory> using namespace std; int main(){ //this just builds a 2D array pi that looks like //0 1 2 3 4 //5 6 7 8 9 //10 11 12 13 //... 24 int** pi=new int*[5]; //this counter is augmented by 5 in every... Add solution