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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -