Click here to Skip to main content
15,895,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Thanks for all you guys's replies,

Unfortunately, at least 3-nested loop is a common practice:
while( )
{
   for( ; ; ){  

       for( ; ; ){  

       }
   }
}


Java does not have goto statement at all, but in order to jump out of a several-nested loop, Java has a smart extended break statement, it works like this:
first:{
  second:{
      third:{ 

         System.out.println("Before break.");
         if(condition) 
              break second;
 
         System.out.println("This won't execute.");
     }
  }
  System.out.println("after second block.");
}


As we see, it does the job of breaking out of a loop, and it won't have the problem of goto statment which will easily destroy a program's structure. Jave really is a great language, if only it was a system language like C/C++.



-----------------------------
C++ without virtual functions is not OO. Programming with classes but without dynamic binding is called "object based", but not "object oriented".
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 
GeneralRe: Posting registerd window messages fail Pin
Mike Dimmick25-Jul-04 5:36
Mike Dimmick25-Jul-04 5:36 
GeneralRe: Posting registerd window messages fail Pin
McByte25-Jul-04 20:17
McByte25-Jul-04 20:17 

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.