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.

Required fields*

5
  • 7
    \$\begingroup\$ 16 C compilers later... +1. \$\endgroup\$ Commented Feb 12, 2018 at 0:33
  • 1
    \$\begingroup\$ Cracked! \$\endgroup\$ Commented Feb 12, 2018 at 3:28
  • 8
    \$\begingroup\$ For those who don't understand why this has so many upvotes (I 5 minutes ago): The normal signature of main function is main(int argc, char** argv), X takes the place of argc here. Normal C compilers take argc=1 and argv[0] is the path to the executable. \$\endgroup\$ Commented Feb 12, 2018 at 3:58
  • \$\begingroup\$ Why a specific compiler? I get this to work with both GCC and Clang on amd64 and GCC on armhf. \$\endgroup\$ Commented Jun 11, 2021 at 19:21
  • 1
    \$\begingroup\$ @OskarSkog: With most ways of running a C program this will output starting at 2. The starting value of X is the number of command-line arguments, and the name of the program being run usually counts as the first argument, so in order to start with X as 0 (and thus start counting from 1), you need to find a compiler, or a way of running a C program, that defies that convention somehow. \$\endgroup\$ Commented Nov 21, 2021 at 19:36