-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
38 lines (31 loc) · 940 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "command1.h"
#include "command2.h"
#include "command3.h"
#include "funcoesFornecidas.h"
int main(void) {
int command;
char filename[16];
scanf("%d ", &command); //recebe do teclado qual comando usar
fgets(filename, 16, stdin); //recebe do teclado o nome do arquivo a usar
switch (command)
{
case 1: // comando 1
filename[strlen(filename)-1] = '\0'; //troca o \n por um \0
command_1(filename); //executa o comando
binarioNaTela(filename);
break;
case 2: // comando 2
// filename[strlen(filename)-1] = '\0'; //troca o \n por um \0
command_2(filename); //executa o comando
break;
case 3: // comando 3
filename[strlen(filename)-1] = '\0'; //troca o \n por um \0
command_3(filename); //executa o comando
break;
default:
break;
}
}