Entrainements + fin TP structures

This commit is contained in:
Simoes Lukas
2024-12-02 14:12:49 +01:00
parent 161df92584
commit 6f3e79de9d
36 changed files with 1240 additions and 0 deletions

View File

28
DEV1.1/TP24/test.c Normal file
View File

@@ -0,0 +1,28 @@
# 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;
}

1
DEV1.1/TP24/test_e.txt Normal file
View File

@@ -0,0 +1 @@
Ceci est un test avec des e.