MichalStrehovsky / sizegame

Compare binary sizes of canonical Hello World in 18 different languages
209 stars 17 forks source link

c: use valid C and puts instead of printf #4

Closed deltabeard closed 1 year ago

deltabeard commented 1 year ago

Reduces compiled binary from 137kB to 115kB with cl /O1 hello.c. The binary is reduced from 32kB to 14kB when compiled with w64devkit using gcc -Os -s hello.c.

Returning a value in main() is required in C.

MichalStrehovsky commented 1 year ago

The k&r c programming language book starts with printf for hello world. It is the canonical thing. Please look at the rules in Readme.md.

deltabeard commented 1 year ago

Thanks. The rules mention that it is "ideal" to be in some tutorial.