Transposing a matrix in C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Transposing a matrix in C++

Hi, I need help writing a program to transpose a matrix (search it up if you are unaware) using Cpp. Basically, you are given how many rows (which is the same as columns, and then you input (all on one line) the numbers to fill the matrix. Is someone able to do it?

13th Mar 2019, 1:45 AM
Matt Sampson
Matt Sampson - avatar
1 Answer
0
Sure just switch the rows with the columns. You can take a look at an example implementation in my math library here: https://github.com/Erarnitox/dropMath/blob/main/header/dropMath.hpp#L1398
12th Jul 2022, 8:54 AM
Erarnitox
Erarnitox - avatar