[Solved] Replacing the goto Statement

Please let me know if I missed something #include “stdafx.h” #include <iostream> using namespace std; void Print(int count, int countSub, int rolePerGroup, int userCount, int userPerGroup) { for(int roleCount = 1; roleCount<=rolePerGroup; roleCount ++) { if(userPerGroup == 0) { cout<<“Parent groups are: “<< count <<” | “<<“Sub group are : “<<countSub<<” | “<<“Role per Sub … Read more

[Solved] goto vs method in finally block in c#

Isn’t the goto moo and static void moo() doing the same act i.e taking me out of finally block? No, absolutely not. goto moo would transfer control out of the finally block completely. moo() just calls the method, but then when the method returns you’re back in the finally block. If you put a Console.WriteLine(“Still … Read more

[Solved] using goto keyword in C [closed]

If the program really does print 0 for you then there might be a serious problem with your compiler (or even your machine…). My suspicion is that it doesn’t print 0, but your question is really why the program loops infinitely. This is because the if-body only contains the print statement. So when a reaches … Read more