ChinaUnix.net
相关文章推荐:

perl goto

先看一下官方的文档 [quote]The goto-&NAME form is quite different from the other forms of goto. In fact, it isn't a goto in the normal sense at all, and doesn't have the stigma associated with other gotos. Instead, it exits the current subroutine (losing any changes set by local()) and immediately calls in its place the named subroutine using the current value of @_. This is used by AUTOLOAD subr...

by redskywy - Perl - 2010-06-24 16:37:42 阅读(3620) 回复(1)

相关讨论
by freesea - Perl - 2012-09-16 12:23:09 阅读(14737) 回复(4)

大家都知道在kernel里面goto语句大多数是用在错误处理等场合,代码看起来逻辑性更强,更于阅读。 但是在一些条件循环处理代码中也较多的用到了goto语句,下面随便举一个例子。 下面的程序片段是softirq处理函数中的,, asmlinkage void __do_softirq(void) { ........... ........... restart: /* Reset the pending bitmask before enabling irqs */ set_softirq_pending(0); (清除软中断标志) local_irq...

by wmmy2008 - 内核源码 - 2009-12-03 10:23:31 阅读(1690) 回复(3)

现在我的脚本用户交互时需要有“上一步”功能,,比如当用户输入'back'是跳到上一步,,我搜索了一下发现bash shell里没有goto语句,所以不知道该怎么实现这个功能? 如果用perl把用户交互这段shell重写的话,怎么把perl里读入用户的输入传递到shell

by jieao111 - Shell - 2012-10-26 08:55:36 阅读(22104) 回复(6)

实在不明白goto #include int main(void) {         int i=0;         int j=1;         if(i)                 if(j > 10)             ...

by FinalBSD - C/C++ - 2009-03-19 12:03:59 阅读(1874) 回复(8)

*QRG7047 THE goto BRANCHES FROM DETAIL THE CALCULATION TO THE subtine calculation specification ignored. :send target of detail goto or cabxx is inside subroutine. [code]...... goto send ........ ...... SEND TAG SETON LR 请帮忙提示哪里会有问题?? [/code]

by hliu - AS400 - 2004-10-14 21:24:37 阅读(1054) 回复(3)

[code]#include int main() { int i; for(i = 0; i < 100; i++) { int k; for(k = 0; k < 100; k++) { if(k%3 == 0) { goto next_file; } } next_file: } return(0); }[/code]$ cc t.c t.c: In function 'main': t.c:16: error: label at end of compound statement ------------------------- $ g++ t.cpp t.cpp: In function 'int main()': t.cpp:22: error: ...

by inet_addr - C/C++ - 2012-07-05 21:11:44 阅读(2865) 回复(7)

还是能解决大问题的 。。。

by snow888 - C/C++ - 2009-08-16 00:31:36 阅读(3287) 回复(21)

不知道shell 脚本能否写成类似C里面的goto功能啊 a: # shell script a ........................ if [ ...... ]; then goto a fi # shell script b 请问上面的可行么?谢谢

by gigabyte - Shell - 2008-03-01 15:48:30 阅读(2622) 回复(2)

如题! 我是新手,很多时候公司编程规范上写着:禁止使用goto语句,但是我觉得在错误处理时使用goto语句会比较有效,看起来代码层次更加清晰,容易理解! 我想请教一下大侠们,关于goto语句,到底该不该用?如果可以用,怎么用才不会使程序乱掉,而变得更加简洁,可读性强! 谢谢~~

by ft3329831 - Linux新手园地 - 2012-08-28 19:09:13 阅读(844) 回复(0)

本帖最后由 三月廿七 于 2012-01-01 12:01 编辑 尤其是 林锐,我都怀疑他写过程序没有,懂不懂什么是流程控制 很明显 goto 是一个不可缺少的关键字嘛,

by 三月廿七 - C/C++ - 2014-02-26 10:27:29 阅读(20780) 回复(107)