>warning: no newline at end of file
Go to the end of the file and hit enter. Save and recompile.
>undefined reference to `sin'
Did you link to the math library?
gcc src.c -lm
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
>the link is (#include ) ok
math.h is the header that contains declarations. Did you link to the math library that has object code as I gave an example for? If not then the next question is moot because your code will never compile.
>somebody says the output is in radiants while other say in decimal numbers
...You're confused. There are two potential representations for the value returned by sin, radians and degrees. sin as defined by the standard returns radians and it's trivial to convert radians to degrees, just multiply by 180 / pi. As for decimal numbers, I assume you mean floating-point, which is the type that sin returns.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
>I think your'e confused.
For some reason I kept typing return when I meant compute. I have no excuse.
And please use the correct terminology, I hate to be corrected by someone who says radiants when they mean radians. It just makes me feel even dumber to be corrected by someone totally clueless.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401