Macros for ex12

This commit is contained in:
Timo Schmidt 2023-03-24 01:41:16 +01:00
parent f7ce97499b
commit e22e2b2191
1 changed files with 13 additions and 17 deletions

View File

@ -6,7 +6,7 @@
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */ /* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/21 05:44:01 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 <stdio.h> #include <stdio.h>
#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) int main(void)
{ {
char *ptr = "\x42\x6f\x6e\x6a\x6f\x75\x72\x20\x6c\x65" char *ptr = STR;
"\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";
ft_print_memory(ptr, 92); ft_print_memory(ptr, 92);
return (0); return (0);
} }