How do I fix an “ambiguous” function call?

后端 未结 4 1142
礼貌的吻别
礼貌的吻别 2021-02-18 14:59

I\'m working on a C++ program for class, and my compiler is complaining about an \"ambiguous\" function call. I suspect that this is because there are several functions defined

4条回答
  •  时光取名叫无心
    2021-02-18 15:37

    Try using fabs defined in . It takes float, double and long double as arguments. abs is defined both in and . The difference is abs(int), abs(long) and abs(long long) are defined in while other versions are defined in .

提交回复
热议问题