This is actually quite interesting and works differently on Microsoft Visual Studio 2008 and Dev C++(using mingw);
1. Microsoft Visual Studio 2008cmath is basically a wrapper that calls math.h.
In math.h if running in C mode you only get one power function pow(double, double).
In C++ mode (which we are using) you get the c++ overloaded functions: long double pow(long double,int), float pow(float,int), double pow(double,int) and a few others.
So calling pow(int, int) for example pow(3,2) will always fail due to ambiguity whether you include cmath or math.h
2. DEV C++ with MINGW
With this set up, math.h just contains the the usual C function pow(double, double) - so all the functions work because with pow(int, int) both ints get promoted to double by compiler and all is OK cmath in more than a wrapper for math.h. First it includes math.h and then undefines a whole lot of stuff that math.h defined, and substitutes the c++ versions.
This includes the pow function declaration.
As the c++ overloaded functions (same as any other c++ compiler), you will get the ambiguity problem - when using pow(int, int).
P.S The ambiguity occurs with pow(int, int) because integers can be promoted to floats or doubles, which means that pow(int, int) can fit any of the 6 or so overloaded c++ pow function - so the compiler gets confused.