Disclaimer, I not do anything in particular with regards this question, just curious.
Is it possible to take address of instruction or block in C? in essence, is there jump equivalent in C?
for example:
void function() {
int k;
{ // is a possible to go to this address from arbitrary point in code?
int i, j;
k += j+i;
}
}
thank you
Yes, use goto
:
void function() {
int k;
{ // is a possible to go to this address from arbitrary point in code?
myLabel:
int i, j;
k += j+i;
}
// stuff
goto myLabel;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.