home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / elem-c.zip / M_READ.C < prev    next >
C/C++ Source or Header  |  1985-05-18  |  4KB  |  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. }