1>------ Build started: Project: ALLEGRO_TEST, Configuration: Debug Win32 ------
1> main.cpp
1>c:\users\matt cromer\documents\visual studio 2010\projects\allegro_test\allegro_test\ball.h(203): error C2668: 'pow' : ambiguous call to overloaded function
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(497): could be 'double pow(double,int)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(535): or 'float pow(float,int)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(583): or 'long double pow(long double,int)'
1> while trying to match the argument list '(int, int)'
1>c:\users\matt cromer\documents\visual studio 2010\projects\allegro_test\allegro_test\ball.h(203): error C2668: 'pow' : ambiguous call to overloaded function
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(497): could be 'double pow(double,int)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(535): or 'float pow(float,int)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(583): or 'long double pow(long double,int)'
1> while trying to match the argument list '(int, int)'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm just trying to use the distance formula for the coordinates of the balls.
All of the variables I am calling are integers... what am I doing wrong?
I am also new to c++, but it looks like you need to typecast your first variable into either, double, float or long double in order for it to match one of the overloaded functions.
I was confused, because I thought that the compiler would check the variable types and be like okay, they're good already! And I was confused about the syntax of doing it. I thought it went infront of pow.