Thefaceofbo

Matrix Display (C)

Nov 10th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int display(float *, int, int);
  5.  
  6. int display(float *m, int rows, int cols) {
  7.    int x,y = 0;
  8.    for (x=0; x < rows; x++) {
  9.       for (y=0; y < cols; y++) {
  10.          printf("%f ", m[x*cols + y]);
  11.       }
  12.       printf("\n");
  13.    }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment