What do you want to save?
Add Code snippet
New code examples
-
C++ 2021-10-28 18:36:05
removing element from vector while iterating c++
#include <iostream> #include <vector> #include <algorithm> int main() { std::vector<int> v = { 1, 2, 3, 4, 5, 6 }; auto it = v.begin(); while (it... Add solution -
C++ 2021-10-27 21:04:05
error: use of parameter outside function body before ] token c++, 2D array in c++
If you are using GCC, then you are to pass the length of the array as a parameter to the function. void foo (int m, int arr[][m]) { //... } However, there seems to be a bug in either the compiler or the documentation, as the above function prototype ... Add solution -
C++ 2021-10-25 02:54:11
vector in c
#include <vector> std::vector<std::string> x; Add solution -
C++ 2021-10-19 20:29:06
c++ get map keys
template<typename TK, typename TV> std::vector<TK> extract_keys(std::map<TK, TV> const& input_map) { std::vector<TK> retval; for (auto const& element : input_map) { retval.push_back(element.first); } return retv... Add solution