Can I make a pointer to the code, and pass to the next instruction?

Posted by drigoSkalWalker on Stack Overflow See other posts from Stack Overflow or by drigoSkalWalker
Published on 2010-06-11T20:27:52Z Indexed on 2010/06/11 20:32 UTC
Read the original article Hit count: 151

Filed under:

Like this link http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Labels-as-Values.html
I can get the memory address of an label, so if I declare a label, get your address, and add your address, i will pass to next instruction? some ilustration >


int main () {
   void *ptr;
   label:

    instruction 1;
    instruction 2;

   ptr = &&label;

   // So if I do it...

   ptr = ptr + 1;
  // I will get the instruction 2 correct??

Thanks for all answers.

© Stack Overflow or respective owner

Related posts about c