title: Repeat statement for switch case
body: <p>So I want make the program that can input data many times, for example I choose case 1 again after I use case 1 to input data. Or I choose case 2 many times to see all data as I want.</p>
  
  <p>Mostly said break statement bring the solution. But, when I using break statement after case, the program was terminated. So how I can make repeat switch statement without make terminating program?</p>
  
  <p>If I make this, the switch case happen sequentially. Example, I can input case 1 normally but when I input case 1 again it will go to next case instead case 1 and vice versa until exit case. This is my source code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #pragma hdrstop
  
  using namespace std;
  
  struct ig
  {
  int id;
  string name;
  ig *next;
  ig *prev;
  };
  ig *head= NULL;
  ig *tail= NULL;
  
  //---------------------------------------------------------------------------
  
  int main(int argc, char** argv) 
  {
  
  cout&lt;&lt;"+---------------------------------------+"&lt;&lt;endl;
  cout&lt;&lt;"|    Instagram User Data |"&lt;&lt;endl;
  cout&lt;&lt;"+---------------------------------------+"&lt;&lt;endl;
  cout&lt;&lt;"|1. Add Instagram ID     |"&lt;&lt;endl;
  cout&lt;&lt;"|2. Look All Data            |"&lt;&lt;endl;
  cout&lt;&lt;"|3. Look Previous Data       |"&lt;&lt;endl;
  cout&lt;&lt;"|4. Look Next Data       |"&lt;&lt;endl;
  cout&lt;&lt;"|5. Exit             |"&lt;&lt;endl;
  cout&lt;&lt;"+---------------------------------------+"&lt;&lt;endl;
  int choose,l;
  cout&lt;&lt;"your choices (1/2/3/4/5): ";cin&gt;&gt;choose;
  switch(choose)
  {
      case 1:
          {
              cout&lt;&lt;"Input limit : ";cin&gt;&gt;l;
  
              for(int a=1;a&lt;=l;a++)
              {
                  ig *new= new ig;
                  new-&gt;next=NULL;
                  new-&gt;prev=NULL;
                  cout&lt;&lt;"Entry Number : ";cin&gt;&gt;new-&gt;id;
                  cout&lt;&lt;"Instagram ID : ";cin&gt;&gt;new-&gt;name;
                  cout&lt;&lt;"===================="&lt;&lt;endl;
  
                  if(head== NULL)
                  {
                      head=new;
                      tail=new;
                  }
                  else
                  {
                      new-&gt;prev=tail;
                      tail-&gt;next=new;
                      tail=new;
                  }
              }
          }
  
      cout&lt;&lt;"your choices (1/2/3/4/5)";cin&gt;&gt;choose;
      case 2:
          {
              while(head!= NULL)
              {
                  cout&lt;&lt;head-&gt;id&lt;&lt;endl;
                  cout&lt;&lt;head-&gt;name&lt;&lt;endl;
                  head=head-&gt;next;
              }
          }
      cout&lt;&lt;"your choices (1/2/3/4/5)";cin&gt;&gt;choose;
      case 3:
          {
              if(tail=NULL)
              {
              ig *show;
              show=head;
              while(show!= NULL)
                  {
                      cout&lt;&lt;head-&gt;id&lt;&lt;endl;
                      cout&lt;&lt;head-&gt;name&lt;&lt;endl;
                      head=head-&gt;prev;
                  }   
              }
              else
              {
                  cout&lt;&lt;"Data belum terisi"&lt;&lt;endl;
              }
          }
      cout&lt;&lt;"your choices (1/2/3/4/5)";cin&gt;&gt;choose;
      case 4:
          {
              ig *show;
              show=tail;
              while(show!= NULL)
              {
                  cout&lt;&lt;tail-&gt;id&lt;&lt;endl;
                  cout&lt;&lt;tail-&gt;name&lt;&lt;endl;
                  tail=tail-&gt;next;
              }
          }
      cout&lt;&lt;"your choices (1/2/3/4/5)";cin&gt;&gt;choose;
      case 5:
          {
              return 0;
          }
  }
  }
  </code></pre>
  
  <p>I tried to learn the logic of statement and the solution many times, but still unsuccessful. So I need help here, thank you</p>