用到了cmath中的pow函数~~
x=pow(2,3);
结果就出了一大堆错误,郁闷啊
把错误信息给大家看一下,希望大家给个意见~
79006\Main.cc:14: error: call of overloaded `pow(int, int&)' is ambiguous
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h:150: note: candidates are: double pow(double, double)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:361: note: long double std::pow(long double, int)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:357: note: float std::pow(float, int)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:353: note: double std::pow(double, int)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:349: note: long double std::pow(long double, long double)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:345: note: float std::pow(float, float)
79006\Main.cc:17: error: call of overloaded `pow(int, int&)' is ambiguous
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h:150: note: candidates are: double pow(double, double)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:361: note: long double std::pow(long double, int)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:357: note: float std::pow(float, int)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:353: note: double std::pow(double, int)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:349: note: long double std::pow(long double, long double)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:345: note: float std::pow(float, float)
79006\Main.cc:24: error: call of overloaded `pow(int, int&)' is ambiguous
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h:150: note: candidates are: double pow(double, double)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:361: note: long double std::pow(long double, int)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:357: note: float std::pow(float, int)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:353: note: double std::pow(double, int)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:349: note: long double std::pow(long double, long double)
bin/gcc/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/cmath:345: note: float std::pow(float, float)
但是在VC6.0中就完全正确~~
不解啊~~~