Click here to Skip to main content
15,914,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
bikram singh24-Jul-04 21:53
bikram singh24-Jul-04 21:53 
GeneralRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
Kevin McFarlane25-Jul-04 6:52
Kevin McFarlane25-Jul-04 6:52 
GeneralRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
bikram singh26-Jul-04 7:35
bikram singh26-Jul-04 7:35 
GeneralRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
Kevin McFarlane30-Jul-04 8:24
Kevin McFarlane30-Jul-04 8:24 
GeneralRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
bikram singh31-Jul-04 2:32
bikram singh31-Jul-04 2:32 
AnswerRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
Nemanja Trifunovic25-Jul-04 5:54
Nemanja Trifunovic25-Jul-04 5:54 
GeneralRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
David Crow26-Jul-04 4:29
David Crow26-Jul-04 4:29 
GeneralRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
Henry miller26-Jul-04 6:48
Henry miller26-Jul-04 6:48 
If you don't have it, you really should... Still there are those who can't afford it (yet...).

This is from the special edition, which should be identical to the 3rd edition except most of the errata is corrected. (I used snip where I cut some text that is interesting, but doesn't apply here) I copied this by hand, so mistakes are mine.

Page 137:
The goto has few uses in general high-level programing, (snip)
The goto can also be important in the rare save in which optimal efficiency is essential, (snip)

(snip a couple paragraphs)
One of the few sensible uses of goto in ordinary code is to break out from a nested loop or switch statement.

There you have it: Most of the time goto should not be used. However there are exceptions to that rule, where goto makes the code more readable, or where there is critical speed problem that can be corrected by goto, use it.

Remember when applying the latter that the premature application of optimization is evil! Only do so when you can't get a better algorithm or CPU, and a profiler reveales that this area is a problem. Goto will only at best save a few cycles from your loop, so it rarely is enough of a solution to help speed problems. Sometimes embedded systems run into those cases where it matters.
AnswerRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
palbano25-Jul-04 17:47
palbano25-Jul-04 17:47 
GeneralRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
Link260025-Jul-04 18:04
Link260025-Jul-04 18:04 
GeneralRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
palbano25-Jul-04 18:43
palbano25-Jul-04 18:43 
GeneralRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
bikram singh26-Jul-04 7:33
bikram singh26-Jul-04 7:33 
AnswerRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
KarstenK25-Jul-04 21:20
mveKarstenK25-Jul-04 21:20 
GeneralRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
Link260026-Jul-04 1:29
Link260026-Jul-04 1:29 
AnswerRe: Jumping out of a heavily-nested looping noy by using "goto" statement? Pin
Chris Hills28-Jul-04 1:31
Chris Hills28-Jul-04 1:31 
GeneralNeed source code for adaptive Rice coding Pin
huffmancoding24-Jul-04 14:38
huffmancoding24-Jul-04 14:38 
GeneralRe: Need source code for adaptive Rice coding Pin
Ravi Bhavnani24-Jul-04 14:48
professionalRavi Bhavnani24-Jul-04 14:48 
GeneralRe: Need source code for adaptive Rice coding Pin
huffmancoding25-Jul-04 7:05
huffmancoding25-Jul-04 7:05 
GeneralRe: Need source code for adaptive Rice coding Pin
Ravi Bhavnani25-Jul-04 12:07
professionalRavi Bhavnani25-Jul-04 12:07 
GeneralReset Button ID Pin
PJ Arends24-Jul-04 12:19
professionalPJ Arends24-Jul-04 12:19 
GeneralRe: Reset Button ID Pin
Ravi Bhavnani24-Jul-04 14:45
professionalRavi Bhavnani24-Jul-04 14:45 
GeneralRe: Reset Button ID Pin
PJ Arends25-Jul-04 5:10
professionalPJ Arends25-Jul-04 5:10 
GeneralPosting registerd window messages fail Pin
McByte24-Jul-04 11:13
McByte24-Jul-04 11:13 
GeneralRe: Posting registerd window messages fail Pin
palbano24-Jul-04 11:21
palbano24-Jul-04 11:21 
GeneralRe: Posting registerd window messages fail Pin
McByte24-Jul-04 23:44
McByte24-Jul-04 23:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.