title: g++ expected ';' before return
body: <p>i got the following code beacuse im trying to understand the usage of getopt_long. everything seems fine but i get "expected ';' before return". What am i missing? Thank you all. </p>
  
  <pre><code>int next_option;
  const string short_options = "a:bcde";
  const struct option long_options[] = 
  {
      {"op1", 1, NULL, 'a'},
      {"op2", 1, NULL, 'b'},
      {"op3", 1, NULL, 'c'},
      {"op4", 0, NULL, 'd'},
      {"op5", 0, NULL, 'e'},
      { NULL,0, NULL, 0}
  };
  
  do
  {
      next_option = getopt_long(argc,argv,short_options.c_str(),long_options,NULL);
  
      switch(next_option)
      {
          case 'a':
          cout &lt;&lt;" ";
          break;
  
          case 'b':
          cout &lt;&lt;" ";
          break;
  
          case 'c':
          cout &lt;&lt;" ";
          break;
  
          case 'd':
          cout &lt;&lt;" ";
          break;
  
          case 'e':
          cout &lt;&lt;" ";
          break;
  
          case '?': // invalid option
          cout &lt;&lt;" ";
          break;
  
          case -1:  //no more option
          cout &lt;&lt;" ";
          break;
  
          default:
          cout &lt;&lt;" ";
          break;
      }
  
  }
  while(next_option!=-1)
  return 0;
  </code></pre>
  
  <p>What's the procedure i have to follow to help me resolve errors of that kind?</p>