syntax - C# goto use - what else to use here? -
syntax - C# goto use - what else to use here? -
i know using goto people avoid, have read on various places useful if need simple code. have simple programme needs repeated if user selects so:
static void main() { restart: ... string userchoice=console.readline(); if (userchoice=="y") goto restart; }
is using goto here bad? cannot see other way how repeat code without doing loops etc. seems straightforward , clean way. or missing something?
string userchoice; { userchoice=console.readline(); } while (userchoice=="y");
c# syntax goto
Comments
Post a Comment