#include <stdio.h>
#include <stdlib.h>
#define linhas 4
#define colunas 2
void teste1(float * t1, int totalLinhas, int totalColunas) {
for (int i = 0; i < totalLinhas* totalColunas; i++) {
printf("%f\t", *((t1
+ (i
% totalLinhas
) * totalColunas
) + (i
/ totalLinhas
))); }
}
int main() {
float t1[linhas][colunas];
for (int i = 0; i < linhas * colunas; i++) {
t1[i % linhas][i / linhas] = i + 1;
}
teste1((float *)t1, linhas, colunas);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCiNkZWZpbmUgbGluaGFzIDQKI2RlZmluZSBjb2x1bmFzIDIKCnZvaWQgdGVzdGUxKGZsb2F0ICogdDEsIGludCB0b3RhbExpbmhhcywgaW50IHRvdGFsQ29sdW5hcykgewogICAgZm9yIChpbnQgaSA9IDA7IGkgPCB0b3RhbExpbmhhcyogdG90YWxDb2x1bmFzOyBpKyspIHsKICAgICAgICBwcmludGYoIiVmXHQiLCAqKCh0MSArIChpICUgdG90YWxMaW5oYXMpICogdG90YWxDb2x1bmFzKSArIChpIC8gdG90YWxMaW5oYXMpKSk7CiAgICB9Cn0KaW50IG1haW4oKSB7CiAgICBmbG9hdCB0MVtsaW5oYXNdW2NvbHVuYXNdOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsaW5oYXMgKiBjb2x1bmFzOyBpKyspIHsKICAgICAgICB0MVtpICUgbGluaGFzXVtpIC8gbGluaGFzXSA9IGkgKyAxOwogICAgfQogICAgdGVzdGUxKChmbG9hdCAqKXQxLCBsaW5oYXMsIGNvbHVuYXMpOwogICAgZ2V0Y2hhcigpOwogICAgcmV0dXJuIDA7Cn0K