Cleanups.
[TD_C.git] / exo3 / exo3.c
diff --git a/exo3/exo3.c b/exo3/exo3.c
deleted file mode 100644 (file)
index d1b0956..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <stdio.h>
-
-//FIXME: Comment the code !!!
-
-void swap(char* v1, char* v2) {
-    if (v1 != v2) {
-        char tmp = *v1;
-        *v1 = *v2;
-        *v2 = tmp;
-    }
-}
-
-int stringLength(const char* str) {
-    int length;
-
-    for(length = 0; str[length] != '\0'; ++length);
-    return length;
-}
-
-// FIXME: this function have issues with non english characters
-void reverseString(char* str) {
-    int length = stringLength(str);
-
-    for (int i = length - 1; i >= length/2; --i) {
-        swap(&str[i], &str[(length - 1) - i]);
-    }
-}
-
-int main() {
-    char msg[] = "Bonjour et a bientot";
-    int length = stringLength(msg); 
-
-    printf("La chaine de caracteres est \"%s\" et a pour longueur %d caractere(s)\n", msg, length);
-    reverseString(msg);
-    printf("La chaine inversee de caracteres est \"%s\"\n", msg);
-
-    return 0;
-}