0
I’m trying to pass a typedef struct as a parameter to a function, but it gives the error: "Bib. h:6:13: error: Unknown type name 'matrix'" Here is the code:
#include "bib.h"
typedef struct
{
int matriz[N][N];
}matriz;
void gerarMatriz(matriz m);
int
main()
{
matriz m1;
gerarMatriz(m1);
return(0);
}
And the library Bib. h:
#include <stdio.h>
#define N 5
void
gerarMatriz(matriz m)
{
int i;
for(i = 0; i < N; i++)
{
printf("%d\n", (1 + rand() % 20));
}
}
I’m still not doing anything with struct in function! Just testing a few things.