I have made a mistake calling the function ‘. I spent a lot of time to understand why the compiler just ignores my function. Why it is not reported during compile time? The compiler builds everything without errors but tere is no messagebox with “2”.
#include "stdafx.h"
#include <windows.h>
void tstB()
{
MessageBox(NULL, "2", NULL, NULL);
}
int _tmain(int argc, _TCHAR* argv[])
{
MessageBox(NULL, "1", NULL, NULL);
tstB;
return 0;
}
It’s not an error because it is a valid expression. The result of the expression is a function pointer. You could use the expression like this: