fork download
  1. #include<stdio.h>
  2. #include <stdlib.h>
  3. void print(int *matriz, int lin, int col) {
  4. for (int i = 0; i < lin; i++) {
  5. for (int j = 0; j < col; j++) printf("%d, ", *(matriz + i * col + j));
  6. }
  7. }
  8.  
  9. int main() {
  10. int * a = malloc(9 * sizeof(int));
  11. print(a, 3, 3);
  12. }
  13.  
  14. //https://pt.stackoverflow.com/q/87638/101
Success #stdin #stdout 0s 4328KB
stdin
Standard input is empty
stdout
0, 0, 0, 0, 0, 0, 0, 0, 0,