n********r 发帖数: 65 | 1 我写的一个程序用到复数类,
还用到复数的abs,norm之类的函数,
写的时候直接abs(变量)
用g++编译没有问题
用vc编译的时候我发现abs要写成
std::abs才行
这是什么原因? |
o******r 发帖数: 259 | 2 using namespace std;
【在 n********r 的大作中提到】 : 我写的一个程序用到复数类, : 还用到复数的abs,norm之类的函数, : 写的时候直接abs(变量) : 用g++编译没有问题 : 用vc编译的时候我发现abs要写成 : std::abs才行 : 这是什么原因?
|
n********r 发帖数: 65 | 3 gcc里面不用
using namespace std;
就可以用abs ,norm
为什么?
【在 o******r 的大作中提到】 : using namespace std;
|
c*******a 发帖数: 18 | 4 are you sure?
then it must mean you used the following include
#include
instead of
#include
【在 n********r 的大作中提到】 : gcc里面不用 : using namespace std; : 就可以用abs ,norm : 为什么?
|
n********r 发帖数: 65 | 5 norm 在 math.h里没有定义吧?
abs给出的是复数的模
【在 c*******a 的大作中提到】 : are you sure? : then it must mean you used the following include : #include : instead of : #include
|