From e759db9e6d08965a83ca70edbc1b6112c4914da3 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Mon, 7 Mar 2011 17:22:54 +0100 Subject: [PATCH] Some scripts had been deleted --- C_Language/supprime.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 C_Language/supprime.c diff --git a/C_Language/supprime.c b/C_Language/supprime.c deleted file mode 100644 index b10f60c..0000000 --- a/C_Language/supprime.c +++ /dev/null @@ -1,39 +0,0 @@ -// THIS DOESN'T WORK -#include -#include -#include - -void supprime(char *s, char c); -int main(int argc, char **argv) -{ - char * chaine = "Salut tout le monde"; - char c = 'u'; - supprime(chaine, c); - printf("%s\t\t%c\n", chaine, c); - exit(0); -} - -void supprime(char *s, char c) -{ - char * save = s; - while(*s) - { - if(*s == c) - { - printf("On a une correspondance\n"); - while(*s && *(s + 1) != '\0') - { - *s = *(s + 1); - s++; - } - printf("Fin de la boucle : %s", s); - *s = '\0'; - s = save; - } - else - { - s++; - } - save = s; - } -}