Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • \$\begingroup\$ puts(v) may work as well (not very reliable but reliable enough. It depends on the ASLR. Most runs works => good enough). \$\endgroup\$ Commented Jul 18, 2023 at 17:24
  • \$\begingroup\$ I originally had f(n){while(n--)puts(f);} but then saw that function was already submitted, so I pivoted to this. puts(v) will vary based on the input/run, so I decided to go with puts(*v). Maybe I was too strict with the rules on this one. \$\endgroup\$ Commented Jul 18, 2023 at 18:24
  • \$\begingroup\$ Leave it up there, I don't care. I'll also note that f(n){for(;n--;)puts(f);) is the same length. \$\endgroup\$ Commented Jul 18, 2023 at 19:08
  • 1
    \$\begingroup\$ If you creative about the input specification, this will also work: main(a,v)int**v;{for(a=*v[1];a--;puts(*v));} On my machine, to input 0 use ./a.out '' '' '' '', To input 32 ./a.out ' ' '' '' ''. 8224 ./a.out ' ' '' '' '' for 2097184 use ./a.out ' ' ' ' '' '' for 8192 ./a.out '' ' ' '' ''. Not sure how to escape '\x01' in bash but that is a problem of bash not the program. \$\endgroup\$ Commented Jul 19, 2023 at 10:30