treesummaryrefslogcommitdiff
diff options
context:
space:
mode:
authorpatrick-scho2025-09-30 11:37:08 +0200
committerpatrick-scho2025-09-30 11:37:08 +0200
commitaf3d62d765a3604b2ca648b1c8f070c9c94bf8c4 (patch)
treeba5458d0922304fc9dd83457064325600fff02eb
parent817decdb855f81136001a5fa544eb8396202d475 (diff)
downloadonefile-af3d62d765a3604b2ca648b1c8f070c9c94bf8c4.tar.gz
onefile-af3d62d765a3604b2ca648b1c8f070c9c94bf8c4.zip
add printself.cHEADmain
-rw-r--r--printself.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/printself.c b/printself.c
new file mode 100644
index 0000000..dd5f0e1
--- /dev/null
+++ b/printself.c
@@ -0,0 +1,28 @@
+// cc printself.c -o printself && diff <(./printself) printself.c
+#include <stdio.h>
+int main() {
+ const char *f = (const char[]){32,32,32,32,32,32,32,32,34,37,115,34,44,10,0};
+ const char **s = (const char*[]) {
+ "// cc printself.c -o printself && diff <(./printself) printself.c",
+ "#include <stdio.h>",
+ "int main() {",
+ " const char *f = (const char[]){32,32,32,32,32,32,32,32,34,37,115,34,44,10,0};",
+ " const char **s = (const char*[]) {",
+ " };",
+ " for (int i = 0; i <= 4; i++)",
+ " puts(s[i]);",
+ " for (int i = 0; i <= 13; i++)",
+ " printf(f, s[i]);",
+ " for (int i = 5; i <= 13; i++)",
+ " puts(s[i]);",
+ " return 0;",
+ "}",
+ };
+ for (int i = 0; i <= 4; i++)
+ puts(s[i]);
+ for (int i = 0; i <= 13; i++)
+ printf(f, s[i]);
+ for (int i = 5; i <= 13; i++)
+ puts(s[i]);
+ return 0;
+}