title: C++ | main function error | beginners
body: <p>I'm totally new with c++ and I'm using eclipse.</p>
  
  <p>but... I don't know why I get this error at the main function:</p>
  
  <blockquote>
    <p>ERROR: ::main must return int</p>
  </blockquote>
  
  <p>My code is:</p>
  
  <pre><code>void main()
  {
  char a;
  while (a!='q')
  {
      string ln = "enter option: ";
      cout&lt;&lt; ln;
  
      switch(a)
      {
      case 1:
          if (a=='1')
              func1();
          break;
      case 2:
          if (a=='2')
              break;
          break;
      }
  }
  }
  </code></pre>