I want to skip some line of code by checking if condition in the same method. I used goto statement but it showed "cannot jump from this goto statement to the label". Is there any other way I can skip code? what I do is..
if(condition)
goto skipped;
//code to skip
//code to skip
skipped:
//code to execute
There are surely legitimate uses for goto, so I think this deserves a proper answer:
Some possible reasons why you might be failing:
Read more : http://en.cppreference.com/w/cpp/language/goto