From 805f3b695fc8b72f34244b8ccb2c1aab3d0876f2 Mon Sep 17 00:00:00 2001 From: asus Date: Thu, 25 Jan 2024 15:23:13 +0100 Subject: [PATCH] grace with comment and writting into file --- 2_Grace/Grace.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/2_Grace/Grace.c b/2_Grace/Grace.c index f2aea43..bfb97c5 100644 --- a/2_Grace/Grace.c +++ b/2_Grace/Grace.c @@ -1,6 +1,8 @@ #include #define xstr(s) #s #define str(s) xstr(s) -#define MAIN(s) int main() { char *quine = "#include \n#define xstr(s) #s\n#define str(s) xstr(s)\n#define MAIN(s) "s"\n\nMAIN(str(MAIN(s)))\n"; printf(quine); return 0; } - +#define MAIN(s) int main() { char *quine = "#include \n#define xstr(s) #s\n#define str(s) xstr(s)\n#define MAIN(s) "s"\n/*\n comment\n*/\nMAIN(str(MAIN(s)))\n"; FILE *file = fopen("Grace_kid.c", "w"); fprintf(file, "%s", quine); return 0; } +/* + comment +*/ MAIN(str(MAIN(s)))