I'm trying to pass a typedef struct as a parameter to a function but gives the error: "bib.h: 6: 13: error: unknown type name 'array'" 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 bib.h library:
#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 the struct in function! Just testing a few things.