How to use ā€œgotoā€? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 3

How to use ā€œgotoā€?

Can anyone tell me how to use ā€œgotoā€? By the way, what are the advantages and disadvantages of ā€œgotoā€? You can take either C++ or Java for example, for I can only use these two, thank you!

9th Jan 2018, 6:01 AM
Oscar Jin
Oscar Jin - avatar
1 Resposta
+ 7
ex. int i = 5; goto test; i = 0; test: i++; // i = 6 pro: quick way for jump some line of code, exit from nested loop without particular condition. con: goto makes difficult to trace the control flow of a program, making the program hard to understand and hard to modify
9th Jan 2018, 6:34 AM
AtoMX
AtoMX - avatar