What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-03-25 00:00:15
how to use array without size in c++
#include <iostream> int main() { //Create a user input size int size; std::cout << "Enter Size Of Array : "; std::cin >> size; //Create the array with the size the user input int *myArray = new int[size]; //Populate t... Add solution -
C++ 2022-03-22 13:25:16
arrow operator c++
/* the arrow operator is used for accessing members (fields or methods) of a class or struct it dereferences the type, and then performs an element selection (dot) operation */ #include <iostream> using std::cout; class Entity { public: con... Add solution -
C++ 2022-03-20 08:10:06
tuple with functions c++
#include <tuple> #include <iostream> #include <string> #include <stdexcept> std::tuple<double, char, std::string> get_student(int id) { if (id == 0) return std::make_tuple(3.8, 'A', "Lisa Simpson"); i... Add solution -
C++ 2022-03-18 22:30:02
c++ vector insert time complexity
// inserting into a vector #include <iostream> #include <vector> int main () { std::vector<int> myvector (3,100); std::vector<int>::iterator it; it = myvector.begin(); it = myvector.insert ( it , 200 ); myvector.insert... Add solution -
C++ 2022-03-17 03:00:05
nested for loops pyramid c++
//WAP to print triangle pattern... LOGIC int num{}, i{1}; cin >> num; while (i <= num) { for (int space = 1; space <= (num - i); space++) { // space cout << " "; } for (int value = 1; value <= (2 * i -... Add solution -
C++ 2022-03-16 23:40:31
c++ check if odd or even
#include <iostream> using namespace std; int main() { int n; cout << "Enter an integer: "; cin >> n; (n % 2 == 0) ? cout << n << " is even." : cout << n << " is odd.";... Add solution