Hacker News new | ask | show | jobs
by zkarcher 5452 days ago
I can't compile this. What am I doing wrong? Here is the output:

$ gcc -o donut donut.c -lm

donut.c:1: warning: data definition has no type or storage class

donut.c: In function ‘main’:

donut.c:4: warning: incompatible implicit declaration of built-in function ‘printf’

donut.c:5: warning: incompatible implicit declaration of built-in function ‘memset’

2 comments

They're just warnings. I got the same ones but it still created a perfectly good executable. (you kind of have to assume warnings with obfuscated code :)
You need to go add:

  #include <stdio.h> 
  #include <string.h>
and then add int directly before the k on the first line of the donut.
No, he does not. All he needs is:

  ./donut
:)
Using your suggestions, and compiler errors, I got this:

http://pastebin.com/Sg5RhUiJ

TBH, this is beautiful.

That did it. Thanks!