home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / c / c_tutor / c_1 / m_read < prev    next >
Encoding:
Text File  |  1992-11-14  |  414 b   |  22 lines

  1. static char *sccsid = "@(#)m_read.c     4/6/82 (U of Maryland, FLB)";
  2.  
  3. #include <stdio.h>
  4. #include "mat.h"
  5.  
  6. struct matrix *
  7. m_read()
  8. {
  9. register struct matrix *result;
  10. register int row, col;
  11. int rows, cols;
  12.  
  13. scanf("%d%d", &rows, &cols);
  14. m_create(result, rows, cols);
  15.  
  16. for (row = 0; row < rows; row++)
  17.         for (col = 0; col < cols; col++)
  18.                 scanf("%lf", &m_v(result, row, col));
  19.  
  20. return(result);
  21. }
  22.