void replace_all(string& src, const string a, const string b)
{
auto pos = src.find(a);
while(pos != string::npos)
{
src.replace(pos, a.size(), b);
pos = src.find(a, pos);
}
}
string s = "xxx yyy zzz xxx yyy zzz";
replace_all(s, "xxx", "replacedxxx");
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<vector>
using namespace std;
auto rand_arr(int size, int maxrnd)
{
vector<int> result(size);
generate(result.begin(), result.end(), [&](){ return rand() % maxrnd; });
return result;
}
int main()
{
for(auto val : rand_arr(100, 21))
{
cout << val << " ";
}
cin.get();
}
int b[SIZE][SIZE]; //b[0...3][0...3]
//...
for (int iTable = 0; iTable < 4 - 1; iTable++) //плюс потеряли iTable+
//...
for (int iString = 0; iString < 4 - 1; iString++)
-> 0
-> 1
-> 2
//...
b[2][2];
WTF?
в boost он же используется https://www.boost.org/doc/libs/1_68_0/boost/range/...
...
https://ru.cppreference.com/w/cpp/algorithm/revers...
аналогично первому https://www.boost.org/doc/libs/1_68_0/boost/range/...