I'm posting this question here because I'm having an issue at the memory level not the coding level currently I ran the below code
void* Newnumber;
int* ptr;
Newnumber = &dbCircle;
ptr = reinterpret_cast<int*>(Newnumber);
*ptr = 1; //memory error here why?
dbCircle(x, y, RADIUS); //Void function(int, int, int);
This code run in let's say int main() will compile fine but will produce this error:
Unhandled exception at program.exe: 0xC0000005: Access violation writing location 0x004e9e20
Why? essentially this should work as I'm trying to say if you return 1 point to function dbCircle and go from there
What I expect is if 1 is returned to point to void dbCircle function using a reference but for some reason I reach a complex memory error even though the code builds fine. To reproduce you can use any void function that returns 3 ints