I am trying to call function testaddresscall() which is defined like:
void testaddresscall()
{
printf("success");
}
int main(void)
{
void(*testaddresscallfunc)(void);
testaddresscallfunc= &testaddresscall;
cout << *testaddresscallfunc; //it printed 0x012D2050
typedef void testfunc(void);
testfunc* callbyaddress = (testfunc*)0x012D2050;
callbyaddress();
}
Then this happens
Unhandled exception at 0x012D2050 in test.exe: 0xC0000005: Access violation executing location 0x012D2050.