Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<conio.h>
- #include<ctype.h>
- typedef struct Pessoa{
- char Nome[50];
- unsigned int Ra;
- int CodCurso;
- char status;
- Pessoa *prox;
- };
- int main() {
- char OP;
- Pessoa*Novo, *Fim, *Inicio;
- do {
- printf("Digite \n 1 - Inserir \n 2 - Listar \n 3 - Remover \n 4 - Esvaziar \n 5 - Sair ");
- OP = getche();
- switch (OP){
- case'1'://Inserir
- Novo = (Pessoa*)malloc(sizeof(Pessoa));
- if (Novo == NULL)
- printf("Sem Memoria");
- else {
- printf("Nome - ");
- fflush(stdin);
- fgets(Novo->Nome, SYS_OPEN ,stdin);
- printf("RA");
- scanf("%d", &Novo->Ra);
- printf("Cod Concurso");
- scanf("%d", &Novo->CodCurso);
- printf("Status --------");
- Novo->status = toupper(getche());
- Novo->prox == NULL;
- if (Inicio == NULL) {
- Inicio = Novo;
- }
- else
- Fim->prox = Novo;
- Fim = Novo;
- }
- case'2'://Listar
- break;
- }
- } while (OP != 5);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement