if statement - C# Error with 'continue' -
i'm trying use if statement bool make if code runs once not run again. here code using.
int random = program._random.next(0, 133); if (random < 33) { bool done = false; if(done) { continue; // error shown statement } console.writeline("not done!"); done = true; }
the error visual studio displaying is: "no enclosing loop out of break or continue".
depending on class/method requirements, possibly reverse logic:
if (!done) { console.writeline("not done!"); done = true; }
Comments
Post a Comment