Modification utilisation fichier
This commit is contained in:
parent
4c88556d30
commit
b40076f101
1 changed files with 4 additions and 11 deletions
15
turbo_main.c
15
turbo_main.c
|
@ -1,22 +1,15 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#define FILETEST "test"
|
||||||
|
#define FILEINPUT "input"
|
||||||
|
|
||||||
void prem_partie(FILE *ptr);
|
void prem_partie(FILE *ptr);
|
||||||
void deux_partie(FILE *ptr);
|
void deux_partie(FILE *ptr);
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char *filename;
|
char *filename = argc > 1 ? FILETEST : FILEINPUT;
|
||||||
if (argc > 1)
|
|
||||||
{
|
|
||||||
char test[6] = "test";
|
|
||||||
filename = test;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
char input[6] = "input";
|
|
||||||
filename = input;
|
|
||||||
}
|
|
||||||
|
|
||||||
FILE *ptr = fopen(filename, "r");
|
FILE *ptr = fopen(filename, "r");
|
||||||
if (ptr == NULL)
|
if (ptr == NULL)
|
||||||
|
|
Loading…
Reference in a new issue