c++ - Need chars to void function its address? -


need specify address of char array opcodes (&opcodes)? i'm casting void pointer, see indeed specify again address (fp points address opcodes -> points opcodes).

char opcodes[] = "\x41\x41...";  void main() {     void(*fp) (void);     fp = (void *)&opcodes; // opcodes or &opcodes     fp(); } 

perhaps.

the c standard nor c++ standard have answer this. both of them, it's undefined behavior. might vary implementation implementation, if it's possible.

if give specific compiler, might able answer it.


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

javascript - Linking from page A to a specific iframe on page B -

java - Two interface have same method name with different return type -