vector<vector<string>> Reverse(vector<vector<string>> a){
vector<string> dd;
for(int i = 0; i < a.size()/2; i++){
dd = a[i];
a[i] = a[-1*(i) - 1];
a[-1*(i) - 1] = dd;
}
return a;
}
I want to make a Reverse function that reverses vectors in a vector but i get and error:
libc++abi: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc terminating with uncaught exception of type std::bad_alloc: std::bad_alloc