I have to make a program with a menu of options that allows me to read a student's information, write the name and the phone after entering their student number and determine how many students are older than an age entered by the user. The program runs, but it does not record the data to me. I would like to know if you can help me with this problem !!
#include <stdio.h>
struct aluno{
int numero;
char nome[100];
char morada[100];
int idade;
int telefone;
};
void infoPerson(struct aluno *Turma, int *i) {
for (int i = 0; i < 50; i++) {
printf("Introduza o número \n");
scanf(" %d", &Turma->numero);
printf("Introduza a idade \n");
scanf(" %d", &Turma->idade);
printf("Introduza o telefone \n");
scanf(" %d", &Turma->telefone);
printf("Introduza o nome \n");
scanf(" %s", &Turma->nome[100]);
printf("Introduza a morada \n");
scanf(" %s", &Turma->morada[100]);
}
}
int main() {
int opc;
int i = 0;
struct aluno *Turma[2];
do{
do{
printf("1 - Introduzir alunos\n");
printf("2 - Teste\n");
printf("3 - Teste\n");
scanf("%d", &opc);
} while (opc < 0 || opc > 3);
switch (opc){
case 1:
infoPerson(Turma, &i);
break;
case 2:
printf("\n");
break;
case 3:
printf("\n");
break;
default:
printf("Teste\n");
}
} while (opc < 0 || opc > 3);
}