मैं एक सरल करने के लिए math.h someihing समान से pow()
कार्य करने के लिए कॉल ..अस्पष्ट पॉव() फ़ंक्शन
#include<math.h>
int main()
{
float v,w;
w=3.0;
v=pow(w,0.5);//i think this is 'float pow(float,float)'
return 0;
}
लेकिन दृश्य स्टूडियो कहते हैं कि यह एक त्रुटि
1>c:\users\user\documents\visual studio 2008\projects\deo\deo\main.cpp(7) : error C2666: 'pow' : 6 overloads have similar conversions
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(575): could be 'long double pow(long double,int)'
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(573): or 'long double pow(long double,long double)'
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(527): or 'float pow(float,int)'
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(525): or 'float pow(float,float)'
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(489): or 'double pow(double,int)'
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(123): or 'double pow(double,double)'
1> while trying to match the argument list '(float, double)'
है बनाने के लिए कोशिश कर रहा हूँ मैंने सोचा कि मेरे पास प्रारूप float pow(float, float)
था।
कि त्रुटि संदेश की अंतिम पंक्ति पढ़ें। 0.5 को डबल माना जाता है, और संकलक यह नहीं समझ सकता कि इसे ऑटो-रीस्टास्ट करना क्या है क्योंकि कई ऐसे कलाकार हैं जो काम कर सकते हैं। – tloach
मैं 'सी' टैग हटा रहा हूं क्योंकि यह' C++ 'के लिए अद्वितीय है। –