J
Jeffrey Baker
Hi,
I can't get my code to link. I get
Example error LNK2019: unresolved external symbol "void __cdecl f(void *)"
(?f@@YAXPAX@Z) referenced in function _main
and
Example fatal error LNK1120: 1 unresolved externals
Here is the code:
#include <iostream>
using std::cout;
using std::endl;
void f( void(*)); // void(*) is the function pointer argument
void x();
void y();
int main()
{
f(x); // calls x function
f(y); // calls y function
return 0;
}
void f(void *c); // pointer function
void x()
{
cout << "x() is chosen" << endl;
}
void y()
{
cout << "y() is chosen" << endl;
}
Thanks,
jb
I can't get my code to link. I get
Example error LNK2019: unresolved external symbol "void __cdecl f(void *)"
(?f@@YAXPAX@Z) referenced in function _main
and
Example fatal error LNK1120: 1 unresolved externals
Here is the code:
#include <iostream>
using std::cout;
using std::endl;
void f( void(*)); // void(*) is the function pointer argument
void x();
void y();
int main()
{
f(x); // calls x function
f(y); // calls y function
return 0;
}
void f(void *c); // pointer function
void x()
{
cout << "x() is chosen" << endl;
}
void y()
{
cout << "y() is chosen" << endl;
}
Thanks,
jb