sin v/s sinf function in C

后端 未结 3 1487
花落未央
花落未央 2021-01-12 03:50

I am trying to use the sinf function in my C Program but it gives me an undefined reference error under MSVC 6.0, however sin works fine.

T

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-12 04:33

    sinf() was added to C in C99, which Microsoft Visual C++ does not fully support (even so, Visual C++ 6 was released before C99 was standardized).

    You can use the sin() function, which takes a double (sinf() takes a float).

提交回复
热议问题