Answer the question
In order to leave comments, you need to log in
How to reverse array columns?
How can you reverse the columns of a two-dimensional array?
Answer the question
In order to leave comments, you need to log in
Since the question is in the topic about C ++, then you are probably not interested in raw arrays and raw loops. Then you can do this:
#include <algorithm>
std::vector<std::vector<int>> arr = {{0,1,2,3},{0,1,2,3},{0,1,2,3}};
std::for_each(arr.begin(), arr.end(), [](auto& row){ std::reverse(row.begin(), row.end()); });
Can be done with loops and brain drops.
If some blas is used to work with two-dimensional arrays, then most likely there is already a ready-made function for this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question