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

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.