1

My code looks like this: (n is a number among 0,1,2 and 3, and loc_A/B/C/D each represents a block of code)

int test(int n){
    static void *jt[7]= {&&loc_A, &&loc_B, &&loc_C, &&loc_D};
    goto *jt[n];
  loc_A:
    ......
  loc_B:
    ......
  loc_C:
    ......
  loc_D:
    ......
}

What does "&&loc_A" stands for? Is it the address(or location) of the codes which loc_A represents?

4

1 回答 1

1

是的,但它不是标准的 C。相反,它是GNU 语言扩展。因此,最好避免。

于 2013-07-07T04:01:02.420 回答