A question that came to me days ago was whether it is possible to insert a matrix into a structure, I think so, but in the process of deciding to clarify it.
EXAMPLE
typedef struct matrizexemplo {
int matriz[2][2];
}
A question that came to me days ago was whether it is possible to insert a matrix into a structure, I think so, but in the process of deciding to clarify it.
EXAMPLE
typedef struct matrizexemplo {
int matriz[2][2];
}
Perfectly possible. Here is an example use to add two elements of this array:
#include <stdio.h>
typedef struct matriz{
int matriz[2][2];
}Matriz;
int main() {
Matriz uma_matriz;
uma_matriz.matriz[0][0] = 1;
uma_matriz.matriz[1][1] = 2;
// Printa 3 no terminal
printf("%d\n", uma_matriz.matriz[0][0] + uma_matriz.matriz[1][1]);
return 0;
}