Goto a specific Address in C

前端 未结 3 1800
猫巷女王i
猫巷女王i 2021-01-18 12:45

How can I JMP to a specific address in C?

I want to use

goto 0x10080000

This is not working, is there other way I can change the a

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-18 13:38

    In GCC you can use computed goto. I didn't try it myself, but it should work like this:

    void *address = 0x10080000;
    ...
    goto *address;
    

提交回复
热议问题