0

Hello
I am trying to write to a matrix[3][3] to a file column by column and at the end of each column to start from the beginning.
The problem is I have to seek to write at the position a01 once the first column is written then a02 and so on.
Thank you

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Ancient Dragon
0

I assume you mean you want the file to look somethng like this:

1    2     3
4    5     6
7    8     9

just create a loop to count from 0 to 2 and use fout to save each matric element. After the third element is written then write '\n' to cause next line.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.