fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #define linhas 4
  5. #define colunas 2
  6.  
  7. void teste1(float * t1, int totalLinhas, int totalColunas) {
  8. for (int i = 0; i < totalLinhas* totalColunas; i++) printf("%f\t", *((t1 + (i % totalLinhas) * totalColunas) + (i / totalLinhas)));
  9. }
  10. int main() {
  11. float t1[linhas][colunas];
  12. for (int i = 0; i < linhas * colunas; i++) t1[i % linhas][i / linhas] = i + 1;
  13. teste1((float *)t1, linhas, colunas);
  14. }
  15.  
  16. //https://pt.stackoverflow.com/q/43948/101
Success #stdin #stdout 0s 4536KB
stdin
Standard input is empty
stdout
1.000000	2.000000	3.000000	4.000000	5.000000	6.000000	7.000000	8.000000