Using Goto function across different functions

前端 未结 4 2102
心在旅途
心在旅途 2020-12-18 20:58

How can I use goto function across different functions .For ex ,

    main()
    {
      ....
      REACH:
      ......
    }

    void function()
    {
             


        
4条回答
  •  猫巷女王i
    2020-12-18 21:17

    You can't in Standard C; labels are local to a single function.

    The nearest standard equivalent is the setjmp() and longjmp() pair of functions.

    GCC has extensions to support labels more generally.

提交回复
热议问题