在不同的功能使用转到功能 [英] Using Goto function across different functions
本文介绍了在不同的功能使用转到功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何使用goto语句的功能在不同的功能。对于恩,
How can I use goto function across different functions .For ex ,
main()
{
....
REACH:
......
}
void function()
{
goto REACH ;
}
如何实现这样的用法?
How to implement such usage ?
推荐答案
您不能在标准C;标签是本地的一个单一的功能。
You can't in Standard C; labels are local to a single function.
最近的标准等效是<一个href=\"http://pubs.opengroup.org/onlinepubs/9699919799/functions/setjmp.html\"><$c$c>setjmp()$c$c>和
<一href=\"http://pubs.opengroup.org/onlinepubs/9699919799/functions/longjmp.html\"><$c$c>longjmp()$c$c>对函数。
The nearest standard equivalent is the setjmp()
and
longjmp()
pair of functions.
GCC有<一个href=\"http://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc/Labels-as-Values.html#Labels-as-Values\">extensions支持标签更为普遍。
GCC has extensions to support labels more generally.
这篇关于在不同的功能使用转到功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文