Saturday, May 22, 2010

Help me with this another c program...Arrays!!?

A data file called input.txt contains two integers, m, n, specifying the dimensions of an m x n matrix, followed by m lines each with n integer values representing the contents of the matrix. Write a C program to open the file, read m and n, dynamically allocate a two-dimensional array to hold the data and then read the matrix values. Write to a file called output.txt the values n, m followed by n lines of m values each, representing the transpose of the input matrix, i.e., the first column of the input matrix becomes the first row of the output matrix, and so on. Note, the file I/O in this question requires use of functions fopen, fprintf, and fscanf rather than simple redirection.

Help me with this another c program...Arrays!!?
Do you own homework. At least attempt it and post your problems that you are having.
Reply:Seems simple enough, but my guess is that this is probably a school assignment.





I can't just give you the answer, but send me an email with what you have so far and I'll guide you through completing it.





mike dot resnick at sbcglobal dot com





(replace the dot and at with . and @)

columbine

No comments:

Post a Comment