c - 在 iMac 上做 C 教程,遇到一个挑战

标签 c terminal math.h

我正在 Xcode(Apple 的 Mac IDE)上进行 C 编程,并遵循 Big Nerd Ranch 的 Objective C 编程指南一书。挑战问题之一是使用 C 语言的库来显示 1 弧度的正弦值。我导入了 math.h 并做了

双罪 = sin(3.14);

但这给了我一个错误。

最佳答案

1 弧度不是 pi,而是 1。

不能使用作为函数名称的变量名称。

你想要

double myValue = sin(1.0);

关于c - 在 iMac 上做 C 教程,遇到一个挑战,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15305456/

相关文章:

c - 检索 LDAP DN 的空属性

c - 通过C中的套接字发送mp3文件

unix - Ubuntu "you have held broken packages"

linux - 如何查看终端的运行时间? (Ubuntu 用户)

mysql - Homebrew mysql安装报错

c++ - 编译错误: "pointer can only be subtracted from another pointer"

Malloc 的 C 替代方案

c - Visual Studio 2012 中的 #include <math.h>

c - 无重复生成数字组合的算法