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*

6
  • 2
    \$\begingroup\$ Looks like I'm a little late. I found another version though : int main(){for(int c=33;c<144-22+5;c+=1)printf("%c",c);} which still needs stdio.h. \$\endgroup\$ Commented Nov 5, 2014 at 8:56
  • 2
    \$\begingroup\$ Approaches with -include should not be considered valid. It's just like claiming a file containing A can have any behaviour you want, by compiling with the appropriate -DA=... command-line option: your claimed "source" file does not include the complete source. \$\endgroup\$ Commented Nov 5, 2014 at 9:24
  • \$\begingroup\$ @Ethiraric You found my solution, although both are valid. I did not need stdio.h, although I did have stdafx.h. I was told before that I did not need to count that because that is a VS thing. It probably includes stdio.h somewhere in it. \$\endgroup\$ Commented Nov 5, 2014 at 16:23
  • \$\begingroup\$ @hvd I am not compiling with a command-line. I am running this code from Visual Studio and entering no extra commands. Also, VS would not even accept -include anyway - I would need to use #include, so would that invalidate my answer too if it didn't work on your computer? \$\endgroup\$ Commented Nov 5, 2014 at 16:25
  • 1
    \$\begingroup\$ @hosch250 In my opinion, it's fine that you don't count the contents of the stdafx.h file as part of your source (since it's unmodified from what's provided by the implementation, even if it's copied to your project directory), but it's not fine that you don't count the #include "stdafx.h" line as part of your source if it's needed for your project to compile. FWIW, Visual Studio behaves like GCC in that it does accept your intended answer in C mode without any #include directives, as long as precompiled headers are disabled in the project options. \$\endgroup\$ Commented Nov 5, 2014 at 17:12