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*

11
  • \$\begingroup\$ You could use printf instead of puts to avoid a trailing newline. \$\endgroup\$ Commented Oct 29, 2015 at 22:51
  • 20
    \$\begingroup\$ @DigitalTrauma It's because of your avatar, of course \$\endgroup\$ Commented Oct 30, 2015 at 6:27
  • 4
    \$\begingroup\$ Actually, puts can be used, you just need to read fewer characters. \$\endgroup\$ Commented Oct 31, 2015 at 1:41
  • 2
    \$\begingroup\$ @kasperd Yes, guaranteed by C89 \$\endgroup\$ Commented Nov 1, 2015 at 0:06
  • 1
    \$\begingroup\$ Save two bytes: s[50];main(){read(open(__FILE__,0),s,50);puts(s);} by reading only 50 characters you skip the possible newline and can use puts instead of printf. \$\endgroup\$ Commented May 24, 2017 at 3:04