28 lines
546 B
C
28 lines
546 B
C
|
# include <stdio.h>
|
||
|
# include <stdlib.h>
|
||
|
|
||
|
int main(int argc, char** argv) {
|
||
|
FILE* fichier = NULL;
|
||
|
char* lu;
|
||
|
char caractere;
|
||
|
|
||
|
fichier = fopen(argv[1], "r+");
|
||
|
if (fichier == NULL) {
|
||
|
printf("Erreur d'ouverture.\n");
|
||
|
return EXIT_FAILURE;
|
||
|
}
|
||
|
|
||
|
lu = fgets(&caractere, sizeof(char), fichier);
|
||
|
while (lu != NULL) {
|
||
|
if (caractere == 'e') {
|
||
|
printf("%c", )
|
||
|
fseek(fichier, -1, SEEK_CUR);
|
||
|
fputs("X", fichier);
|
||
|
fseek(fichier, 0, SEEK_CUR);
|
||
|
}
|
||
|
lu = fgets(&caractere, sizeof(char), fichier);
|
||
|
}
|
||
|
|
||
|
free(fichier);
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|