From 645db56df769356cd1cd8b2faaeef887f856b10f Mon Sep 17 00:00:00 2001 From: asus Date: Tue, 23 Jan 2024 16:38:28 +0100 Subject: [PATCH] grace ok i think --- 2_Grace/Grace.c | 8 ++++---- 2_Grace/Makefile | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/2_Grace/Grace.c b/2_Grace/Grace.c index eb53d15..dfa4ada 100644 --- a/2_Grace/Grace.c +++ b/2_Grace/Grace.c @@ -1,14 +1,14 @@ -/*comment outside*/ #include #define not_main main char *second_function() { - return "/*comment outside*/%c#include %c#define not_main main%c%cchar *second_function() {%c return %c%s%c;%c}%c%cint not_main() {%c /*comment inside*/%c char *program = second_function();%c printf(program, 10, 10, 10, 10, 10, 34, program, 34, 10, 10, 10, 10, 10, 10, 10, 10, 10);%c return 0;%c}%c"; + return "#include %c#define not_main main%c%cchar *second_function() {%c return %c%s%c;%c}%c%cint not_main() {%c /*comment*/%c FILE *file = fopen(%cGrace_kid.c%c, %cw%c);%c char *program = second_function();%c fprintf(file, program, 10, 10, 10, 10, 34, program, 34, 10, 10, 10, 10, 10, 34, 34, 34, 34, 10, 10, 10, 10, 10);%c return 0;%c}%c"; } int not_main() { - /*comment inside*/ + /*comment*/ + FILE *file = fopen("Grace_kid.c", "w"); char *program = second_function(); - printf(program, 10, 10, 10, 10, 10, 34, program, 34, 10, 10, 10, 10, 10, 10, 10, 10, 10); + fprintf(file, program, 10, 10, 10, 10, 34, program, 34, 10, 10, 10, 10, 10, 34, 34, 34, 34, 10, 10, 10, 10, 10); return 0; } diff --git a/2_Grace/Makefile b/2_Grace/Makefile index 4a9495a..367c8bd 100644 --- a/2_Grace/Makefile +++ b/2_Grace/Makefile @@ -2,7 +2,7 @@ NAME = Grace SRCS = Grace.c CLONE = $(NAME)_kid.c -CREATE_CLONE = ./$(NAME) > $(CLONE) +CREATE_CLONE = ./$(NAME) include ../MakefileCommon