What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-03-02 02:10:08
c++ remove class from vector
#include <algorithm> #include <vector> #include <iostream> class MyClass { public: std::string Name; }; std::vector<MyClass> MyClass_Vector; int main() { MyClass myclass_1; MyClass myclass_2; MyClass myclass_... Add solution -
C++ 2021-11-21 15:25:23
c++ vector get first element
// vector::front #include <iostream> #include <vector> int main () { std::vector<int> myvector; myvector.push_back(78); myvector.push_back(16); // now front equals 78, and back 16 int first = myvector.front(); //first = 78... Add solution -
C++ 2021-10-18 18:48:03
iterate on vector c++
vector<int> myVector; myVector.push_back(1); myVector.push_back(2); myVector.push_back(3); myVector.push_back(4); for(auto x: myVector){ cout<< x << " "; } vector<pair<int,int>> myVectorOfPairs; myVectorOfPair... Add solution
Best helpers
Kyle Smith
+5
JSanchez
+5
Larapsodia
+5
TJG
+5
Sharma Pocso
+5
Wilber82
+5
T-rex
+5
Seria Yin
+5
Winny
+5
Jlund3
+5
Laura Stiehl
+5
Sikku
+5
AlecPerkey
+5
The Alpha
+5
IQAndreas
+5
TeacherSue
+5
Doe John
+5
Wayno
+5