#include <stdio.h>
int main(int argc, char **argv)
{
FILE *file = NULL;
int i = 0;
int j = 0;
if (argc != 2)
{
printf("You forgot the file !!!\n" );
return 1;
}
else
{
printf("plop\n" );
printf("argv[1]: %s\n", argv[1]);
if ((file = fopen(argv[1], "rb" )) == NULL)
{
printf("Can't open the file !\n" );
return 2;
}
/* -ed-
fscanf(file, "< %d %d >", i, j);
pas du C...
*/
fscanf(file, "< %d %d >", &i, &j);
printf("Valeur de i: %d\n", i);
printf("Valeur de j: %d\n", j);
/* -ed-
close(file);
pas du C...
*/
fclose(file);
}
return 0;
}
|