The above code gives me the following error on MSVS .Net 2003:Code:#include <iostream> using namespace std; double p(double b, int e=2) { double r = 1.0; while (e--) r *= b; return r; } double (*pp)(double b); int main() { pp = p; cout << p << " " << p(10.0) << " " << pp << " " << pp(10.0) << endl; return 0; }
test4.cpp(15) : error C2440: '=' : cannot convert from 'double (__cdecl *)(double,int)' to 'double (__cdecl *)(double)'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast