ImReallyBadAtCoding ImReallyBadAtCoding - 1 month ago 12
C Question

C basic - called object is not a function or function pointer

That's my code -

main()
{

double x;
double y = pow(((1/3 + sin(x/2))(pow(x, 3) + 3)), 1/3);
printf("%f", y);

return 0;
}


I get an error in
double y = pow((1/3 + sin(x/2))(pow(x, 3) + 3), 1/3);
, it says that called object is not a function or function pointer. I don't get it though -
(1/3 + sin(x/2))(pow(x, 3) + 3)
is the first element of
pow(x, y);
that is the x I want to raise to y (1/3) power. Where lies the problem? I'm pretty new to c basic but I can't find the answer anywhere.

Answer

If you want to multiply, you need to use the * operator. You can't put parenthesized expressions adjacent to each other to denote multiplication.

(1/3 + sin(x/2))*(pow(x, 3) + 3)