Board logo

標題: 有關C++中的goto的應用 [打印本頁]

作者: 花之慶次    時間: 2007-2-22 01:02     標題: 有關C++中的goto的應用

在撰寫C++程式中, 為什麼很少使用到goto這個語句呢??
作者: jayzhou_2046    時間: 2007-2-22 09:01

引用:
原帖由 花之慶次 於 2007-2-22 01:02 發表
在撰寫C++程式中, 為什麼很少使用到goto這個語句呢??
那是因為怕久而久之,
積了一堆goto後,
會令程式有bug(s).
作者: 滴滴歪    時間: 2007-2-25 11:27

现在讲究结构化设计 一般不建议用goto来跳
作者: template    時間: 2007-3-2 20:37

GOTO is a concept of JUMP transit from assembly language (ASM). In C/C++, there is enough method to replace GOTO, such as IF-ELSE, SWITCH, WHILE... .
作者: jinnib44873    時間: 2007-3-9 23:48     標題: 回復 #1 花之慶次 的帖子

謝謝  給了我很大的幫忙喔  版主  推推
作者: tkor    時間: 2007-4-3 22:50

goto is not recommended in C++ due to its poor performance, but you can still use it for error handlings.
作者: smaller    時間: 2007-4-5 00:04

i use a software 'press',it need use many goto,i write once then not want edit again
作者: xq569    時間: 2007-4-17 12:43

GOTO is a concept of JUMP transit from assembly language (ASM). In C/C++, there is enough method to replace GOTO, such as IF-ELSE, SWITCH, WHILE... .
作者: 丫南    時間: 2007-4-19 18:36

GOOD!!感謝大大無私奉獻!!
作者: sebestianD    時間: 2007-4-25 18:56

Try not to use GOTO .  It is a bad coding style in C++ and make the code much difficult to read and fix in the future.
作者: hong1102    時間: 2007-4-26 21:58

goto虽然很方便,但对于大的程序来说,程序可读性差
作者: melvillo    時間: 2007-4-27 14:31

久而久之,
積了一堆goto後,
會令程式有bug(s).
作者: songthin    時間: 2007-5-5 02:22

GOTO会使程序结构过于混乱




歡迎光臨 香港 Xocat Forum 討論區 (http://p.xocat.com/p/) Powered by Discuz! 6.0.0