Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct {
- char nome[25];
- int matricula;
- float notas[2];
- char situacao[10];
- } Aluno;
- Aluno Alunos[N_ALUNOS];
- int alunosCadastrados = 0;
- void atualizaArray(int posExcluida){
- // Se a posição excluida não for a última
- if(posExcluida < alunosCadastrados - 1){
- // Percorre todo vetor
- for(int j = 0; j < alunosCadastrados; j++){
- // se o índice atual for maior que a posição excluida do vetor
- if(j > posExcluida){
- Alunos[j - 1].matricula = Alunos[j].matricula;
- strcpy(Alunos[j - 1].situacao, Alunos[j].situacao);
- Alunos[j - 1].notas[0] = Alunos[j].notas[0];
- Alunos[j - 1].notas[1] = Alunos[j].notas[1];
- strcpy(Alunos[j - 1].nome, Alunos[j].nome);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement