From e22e2b2191077e3a7b0c211767d3188cdec41f5b Mon Sep 17 00:00:00 2001 From: Timo Schmidt Date: Fri, 24 Mar 2023 01:41:16 +0100 Subject: [PATCH] Macros for ex12 --- ex12/ft_print_memory.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/ex12/ft_print_memory.c b/ex12/ft_print_memory.c index 2cc8343..c404360 100644 --- a/ex12/ft_print_memory.c +++ b/ex12/ft_print_memory.c @@ -6,7 +6,7 @@ /* By: tischmid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/03/21 05:44:01 by tischmid #+# #+# */ -/* Updated: 2023/03/22 20:22:36 by tischmid ### ########.fr */ +/* Updated: 2023/03/24 01:40:48 by tischmid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -91,25 +91,21 @@ void *ft_print_memory(void *addr, unsigned int size) /* //// #include +#define STR "\x42\x6f\x6e\x6a\x6f\x75\x72\x20\x6c\x65" \ + "\x73\x20\x61\x6d\x69\x6e\x63\x68\x65\x73" \ + "\x09\x0a\x09\x63\x07\x20\x65\x73\x74\x20" \ + "\x66\x6f\x75\x09\x74\x6f\x75\x74\x09\x63" \ + "\x65\x20\x71\x75\x20\x6f\x6e\x20\x70\x65" \ + "\x75\x74\x20\x66\x61\x69\x72\x65\x20\x61" \ + "\x76\x65\x63\x09\x0a\x09\x70\x72\x69\x6e" \ + "\x74\x5f\x6d\x65\x6d\x6f\x72\x79\x0a\x0a" \ + "\x0a\x09\x6c\x6f\x6c\x2e\x6c\x6f\x6c\x0a" \ + "\x20\x00" +#define STR2 "HELLO" int main(void) { - char *ptr = "\x42\x6f\x6e\x6a\x6f\x75\x72\x20\x6c\x65" - "\x73\x20\x61\x6d\x69\x6e\x63\x68\x65\x73" - "\x09\x0a\x09\x63\x07\x20\x65\x73\x74\x20" - "\x66\x6f\x75\x09\x74\x6f\x75\x74\x09\x63" - "\x65\x20\x71\x75\x20\x6f\x6e\x20\x70\x65" - "\x75\x74\x20\x66\x61\x69\x72\x65\x20\x61" - "\x76\x65\x63\x09\x0a\x09\x70\x72\x69\x6e" - "\x74\x5f\x6d\x65\x6d\x6f\x72\x79\x0a\x0a" - "\x0a\x09\x6c\x6f\x6c\x2e\x6c\x6f\x6c\x0a" - "\x20\x00"; - // ptr = "hello"; - // ptr = "hello world"; - // ptr = "hello whatever"; - // ptr = "hello loook"; - // ptr = "hello"; - // ptr = "hello"; + char *ptr = STR; ft_print_memory(ptr, 92); return (0); }