I got it to compile in Linux on x86-64, with the following tiny changes:
- Add #include <stdio.h> (for printf())
- Add #include <string.h> (for memset())
- Add "int" before the initial bare declaration of "k"
I compiled it with:
$ gcc -o donut -std=c89 donut.c -lm
Which includes:- Specifying an old language standard to get rid of the need to say "int" before main()
- Linking the math library ("-lm") for the trig functions.
Update: minor grammar and clarification.