I'm trying to use vectors and struct
, but it's not working.
#include <stdio.h>
#include <stdlib.h>
typedef struct Atleta {
float notas[5];
} atleta;
void receberNotas(atleta* l) {
int i;
for(i=0; i<5; i++) {
printf("Digite %d nota: ", (i+1));
scanf("%f", &l[i].notas);
}
}
void mostrarNotas(atleta *l) {
int i;
for(i=0; i<5; i++) {
printf("\n%.2f", l[i].notas);
}
}
int main()
{
atleta *a;
receberNotas(&a);
mostrarNotas(a);
return 0;
}
I could not use this operator - > to access.