I think that crashes the program. Yes, you could write into memory (a char array for instance) executable code and then execute it, but Data Execution Prevention will stop this in Windows (and I don't know about Unix/Linux). To appropriately do this, the memory needs to be maked as executable using VirtualProtect() in Windows.
And just giving an executable name doesn't do the trick. Like I said, most likely this crashes the application.
$ g++ -o test test.cpp
test.cpp: In function βint main(int, char**)β:
test.cpp:4:14: error: β(void*)((char*)(& a))β cannot be used as a function
Which is the compiler saying: "What the hell is that supposed to mean?"