How to store goto labels in an array and then jump to them?

前端 未结 11 1624
说谎
说谎 2020-12-28 16:20

I want to declare an array of \"jumplabels\".

Then I want to jump to a \"jumplabel\" in this array.

But I have not any idea how to do this.

It should

11条回答
  •  Happy的楠姐
    2020-12-28 17:06

    In plain standard C, this not possible as far as I know. There is however an extension in the GCC compiler, documented here, that makes this possible.

    The extension introduces the new operator &&, to take the address of a label, which can then be used with the goto statement.

提交回复
热议问题