diff --git a/TP3/E6.c b/TP3/E6.c index de82d2b..7af6190 100644 --- a/TP3/E6.c +++ b/TP3/E6.c @@ -3,7 +3,7 @@ #include #include -#define N 10 +#define N 20 int length(char* c) { int i, len = -1; @@ -17,7 +17,7 @@ int length(char* c) { } int number(char c) { - return c-48; + return c - '0'; } int atoiMaison(char* c) { diff --git a/TP3/E7.c b/TP3/E7.c index 22aa5f9..8cffeb3 100644 --- a/TP3/E7.c +++ b/TP3/E7.c @@ -29,6 +29,8 @@ int main() { char c[N]; printf("Entrez du texte : "); scanf("%s", &c); - printf("Miroir : %s\n", miroir(c)); + char* m = miroir(c); + printf("Miroir : %s (addresse : 0x%x)\n", m, &m); return 0; } + diff --git a/TP3/Makefile b/TP3/Makefile index a632890..d5b6599 100644 --- a/TP3/Makefile +++ b/TP3/Makefile @@ -1,7 +1,7 @@ all: $(patsubst %.c,%.exe,$(shell ls *.c)) %.exe: %.c - gcc $< -o $@ + gcc $< -o $@ -lm .PHONY: all clean