I have this code
Code:
#include <iostream>
#include <conio.h>
using namespace std;
double Area(double, double);
int main() {
double(*pArea)(double, double);
pArea = Area;
double Length, Width;
cout << "Enter the length and width of your rectangle " << endl;
cin >> Length >> Width;
return 0;
}
And guess what, this code doesn't compile! Whaddya know. I get this error
--------------------Configuration: pointertofunction - Win32 Debug--------------------
Compiling...
pointertofunction.cpp
Linking...
pointertofunction.obj : error LNK2001: unresolved external symbol "double __cdecl Area(double,double)" (?Area@@YANNN@Z)
Debug/pointertofunction.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
I dont' have MSDN so I have no clue what this error means. It seems as though this code SHOULD work, please tell me why it in fact doesn't.
thanks in advanced
NEVERMIND, I DID NOT INCLUDE THE FUNCTION DEFINITION, IT COMPILES NOW, HOW SILLY OF ME
I'VE FIXED EVERYTHING IT WORKS