also I'm assuming (and hoping) that's not the entire code.. "double give_val_x(double x);" will need to be called from main(){}
also not going to guarantee the math to be right but at least that should compile
if you want to get a useful answer you'll need to incorporate "pi" into your equations (or rather, assignments) because sin() and cos() return angles in radians, not degrees... but if you're looking for output in radians it's all good, but then you wouldn't need:
#define pi
of course its not the entire code. that would be silly. no, its just so i can find a value of a function. so variables cant be called in the same line like that? that should help then, let me try that.
p.s. im pretty bad with coding.
No, you don't need to declare that, because that line you wrote double sin(double [random number])IS the function declaration (which is into file math.h or cmath).
oh yeah and just so ya know, xsemel, chervil reminded me of somethin important
if you do use #define keyword value
you will probably not want a semicolon ";" at the end of the line.
the preprocessor will replace "keyword" with "value" exactly at every instance in the code before it is compiled (hope I'm using right terms here)
so something like this:
1 2
#define pi 3.14;
int pie = pi;
which seems solid will actually look like this to compiler: int pie = 3.14;;
see the double ";;"? "pi" is replaced by "3.14;"
instead you just do this:
1 2
#define pi 3.14
int pie = pi;
preprocessor commands (#) don't need to end with a ";"
they continue until the end of the line in the source
just so ya know.
but do like he says ^ and just use const
make c++ gods happy