I'm trying to use the gets
(C language) function, but it does not work. Am I using it the wrong way? The code looks like this:
#include <stdio.h>
typedef struct {
int matricula;
char nome[40];
int nota_1;
int nota_2;
int nota_3;
}aluno;
int main (){
aluno a[5];
int i;
for (i=0; i<5; i++){
printf("Matricula\n");
scanf("%d", &a[i].matricula);
printf("Nome\n");
gets(a[i].nome);
printf("Nota das provas\n");
scanf("%d %d %d", &a[i].nota_1, &a[i].nota_2, &a[i].nota_3);
}
}