From 905588e11c174e3ac2d6bb235c7ab81532f98691 Mon Sep 17 00:00:00 2001 From: thing1 Date: Tue, 24 Sep 2024 11:01:01 +0100 Subject: did some fixes to the compiler around the auto mem free --- comp/lucas-standen-NEA/code2/stdlib/zpylib.c | 10 ++++++++++ comp/lucas-standen-NEA/code2/stdlib/zpylib.h | 1 + 2 files changed, 11 insertions(+) (limited to 'comp/lucas-standen-NEA/code2/stdlib') diff --git a/comp/lucas-standen-NEA/code2/stdlib/zpylib.c b/comp/lucas-standen-NEA/code2/stdlib/zpylib.c index 9932785..86f0dc3 100644 --- a/comp/lucas-standen-NEA/code2/stdlib/zpylib.c +++ b/comp/lucas-standen-NEA/code2/stdlib/zpylib.c @@ -4,6 +4,10 @@ #include "./String/String.h" +void printstr(char *s){ + printf("%s", s); +} + void printchar(char c){ putchar(c); } @@ -16,6 +20,12 @@ void printfloat(double f){ printf("%f", f); } +char *readstr(){ + char *str = calloc(0, 256); + fgets(str, 256, stdin); + return str; +} + char readchar(){ char c; scanf("%c", &c); diff --git a/comp/lucas-standen-NEA/code2/stdlib/zpylib.h b/comp/lucas-standen-NEA/code2/stdlib/zpylib.h index d86dc2d..808ef55 100644 --- a/comp/lucas-standen-NEA/code2/stdlib/zpylib.h +++ b/comp/lucas-standen-NEA/code2/stdlib/zpylib.h @@ -4,6 +4,7 @@ void printstr(char *str); void printint(int i); void printfloat(double f); +char *readstr(); int readint(); void readfloat(double f); int randint(int lower, int upper); -- cgit v1.2.3