Skip to content

Instantly share code, notes, and snippets.

@caioerick
Created October 1, 2013 15:09
Show Gist options
  • Save caioerick/6779976 to your computer and use it in GitHub Desktop.
Save caioerick/6779976 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int narg, char *argv[]) {
system("clear");
int continua = 1;
char opcao;
arquivo = fopen("agenda.txt","r");
while(continua == 1) {
menu();
printf("Opção: ");
scanf("%c", &opcao);
printf("Opção: %c\n", opcao);
if(strcmp(opcao, 'B') == 0) {
search();
continua = 0;
}
else if(strcmp(opcao, 'I') == 0) {
add();
continua = 0;
}
else if(strcmp(opcao, 'A') == 0) {
delete();
continua = 0;
}
else if(strcmp(opcao, 'L') == 0) {
all();
continua = 0;
}
if(continua == 1) {
printf("Opção inválida!\n\n");
}
}
return EXIT_SUCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment