在使用Visual Studio 2010 Express调试器时,我可以输入成员函数,例如:
?visc(alpha,i)
8.2814899360436612e-005
?get_sign()
0.91513417241239037
将代码输入到“即时窗口”中,它们可以正常工作。然而,如果我尝试:
?sin(alpha)
?math.sin(alpha)
?cmath.sin(alpha)
我遇到了错误:Error: symbol "math" not found
。在主文件中,我已经包含了cmath.h头文件,并在代码中使用了sin
、asin
、cos
、acos
、atan2
和sqrt
函数。但是怎样才能在立即窗口中使用这些函数呢?我在谷歌上搜索了我的问题,并发现有人在2005年提出了这个请求,同时也找到了使用成员函数的示例。
cmath
在命名空间std中具有其功能,因此std::sin(alpha)
是否有效? - us2012