std::vector<int> v = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
v.erase(std::remove(v.begin(), v.end(), 5), v.end());
// v will be {0 1 2 3 4 6 7 8 9}
// Delete is like 'free' in C.
// If you have a dynamic variable, you need to free its memory (delete it) using the delete keyword.
int arr = new int[7];
delete arr[];
// Non Empty map example
// CPP program to illustrate
// Implementation of empty() function
#include <iostream>
#include <map>
using namespace std;
int main()
{
map<char, int> mymap;
mymap['a'] = 1;
mymap['b'] = 2;
if (mymap.empty()) {
cout << "True";
}
else {
cout << "False";
}
return 0;
}