I want to print the diagonal of the matrix. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I want to print the diagonal of the matrix.

But don't know to convert pointer into matrix and print the diagonals. https://code.sololearn.com/cIIJ57t0JXqG/?ref=app

29th Apr 2019, 6:01 PM
Mallika Das
Mallika Das - avatar
7 Answers
+ 1
your function printdioganal() get one-dimension array int *, but you need two-dimension array int**
29th Apr 2019, 6:25 PM
Vadim Brovenko
Vadim Brovenko - avatar
+ 1
~ swim ~ Thank you very much. I changed the printf and it worked. Thanks again
29th Apr 2019, 6:58 PM
Mallika Das
Mallika Das - avatar
+ 1
~ swim ~ thank u. Since it got compiled, I thought it's the correct way
29th Apr 2019, 7:27 PM
Mallika Das
Mallika Das - avatar
+ 1
~ swim ~ True. I couldn't test properly. Thanks .
29th Apr 2019, 7:37 PM
Anya
Anya - avatar
+ 1
~ swim ~ yeah understood. Thanks a lot
30th Apr 2019, 7:57 AM
Mallika Das
Mallika Das - avatar
0
How to convert one dimensional into two dimensional without any change in the fuction
29th Apr 2019, 6:32 PM
Mallika Das
Mallika Das - avatar
0
~ swim ~ is there any other way? Without changing the fuction statement and doing some changes in the body of the function.
29th Apr 2019, 6:41 PM
Mallika Das
Mallika Das - avatar