ChinaUnix.net
相关文章推荐:

linux goto 语句 label used but not define

linux内核中goto出现的频率很高,书上说是考虑到内核的执行效率。 但在下面的函数中,如果将goto换成return,那不更直接? 请大虾指教! asmlinkage int sys_execve(struct pt_regs regs) { int error; char * filename; filename = getname((char *) regs.ebx); error = PTR_ERR(filename); if (IS_ERR(filename)) goto out; error = do_execve(filename, (char **) regs.ecx, (char **) regs.edx, ®s); if (error ...

by arcsiny - 内核/嵌入技术 - 2003-05-19 21:11:06 阅读(10895) 回复(16)

相关讨论

有时候真的很佩服搞系统开放的。那么长的代码那么多的变量和函数。。。。 乖乖。。怎么搞?

by system_gong - C/C++ - 2007-08-29 21:21:41 阅读(5016) 回复(20)

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

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

要实现goto的效果该怎么办呢? 效果就和c语言中的goto一样。就是直接跳过一段代码执行。要求不用到{} 用到的地方 start(); code... $cache->end(); code... ?> function start() { code... if($cache) goto end; } function end() { end code... } 就是在类中实现一个部分缓存的东西,如果已经缓存好了,就跳过中间代码,直接到end部分,然后处理显示。 如果你们有什么好办法,不妨共享下。 好象我这...

by rendong237 - PHP - 2006-09-19 11:46:33 阅读(7919) 回复(10)
by freesea - Perl - 2012-09-16 12:23:09 阅读(14759) 回复(4)

在编程时遇到goto语句适应怎样消除,例如: cu=eta/a(n_sp) kint = 0 if( eta 〉 0.1) go to 20 do kint =1, 20, 1 pr = cu solution( w, beta, pr, aa, pd, nodes, dim) cu=0.0e0 do i=1,dim,1 cu = cu + aa(i)*mut(i) end do print " cycle=", kint, " Current estimate of theta =", cu if( abs( cu - pr ) 〈 1.0d-3) go to 20 end do 20 val(0) = eta/a(n_sp) val(1) = teta/a(n_sp)...

by yupeng_cun - Java - 2006-04-28 23:50:23 阅读(1134) 回复(1)

请问shell 中到底有没有 goto 语句?? :?: 该怎么用?或者有没有类似的功能语句

by 彦毅松 - Shell - 2004-05-20 12:25:48 阅读(1726) 回复(2)

请教:DB2存储过程里如何定义标号和使用goto语句? create procedure aaa() LANGUAGE SQL BEGIN ................. ................. goto ERR; .................. .................. ERR: .................. END 这样不行吧?知道的说下,谢谢哦~

by sniperzxl - DB2 - 2006-06-21 16:02:15 阅读(3795) 回复(5)

我想从多层循环的最内层直接跳到最外层循环,从而达到立即结束程序的目的,而break命令只能跳出当前循环,有没有类似goto语句可以实现该功能?谢谢。

by wuwu7456 - 程序开发 - 2003-09-25 20:36:21 阅读(1327) 回复(11)

我想从多层循环的最内层直接跳到最外层循环,从而达到立即结束程序的目的,而break命令只能跳出当前循环,有没有类似goto语句可以实现该功能?谢谢。

by wuwu7456 - Shell - 2003-09-25 13:05:18 阅读(1766) 回复(3)

看的那本书真让我流汗..因为很多印错. 就以下这句: #ifdef __linux ,有地方印 #ifdef _ _linux 有地方印 #ifdef _linux 请问该是怎么样的呢? 我用的是red hat linux 8.02 #ifdef __linux #include<linux/sockios.h> #include<linux/if.h> #else #include #include #include #include #endif

by linuxcici - C/C++ - 2006-10-17 16:49:42 阅读(5148) 回复(10)