title: C++ convert binary to decimal, octal
body: <p>Please i need help debugging the code below.
  I am suppose to produce a code using functions that converts binary numbers to decimal or octal.
  I keep getting error at the switch statement "error too few argument in function call".</p>
  
  <pre><code>#include &lt;iostream.&gt; 
  
  long int menu();
  long int toDeci(long int);
  long int toOct(long int);
  
  using namespace std;
  
  int main () 
  {
  int convert=menu();
  
  switch (convert)
  {
  case(0):
      toDeci();
      break;
  case(1):
      toOct();
      break;
      }
  return 0;
  }
  long int menu()
  {
  int convert;
  cout&lt;&lt;"Enter your choice of conversion: "&lt;&lt;endl;
  cout&lt;&lt;"0-Binary to Decimal"&lt;&lt;endl;
  cout&lt;&lt;"1-Binary to Octal"&lt;&lt;endl;
  cin&gt;&gt;convert;
  return convert;
  }
  
  long int toDeci(long int)
  {
  
  long bin, dec=0, rem, num, base =1;
  
  cout&lt;&lt;"Enter the binary number (0s and 1s): ";
  cin&gt;&gt; num;
  bin = num;
  
  while (num &gt; 0)
  {
  rem = num % 10;
  dec = dec + rem * base;
  base = base * 2;
  num = num / 10;
  }
  cout&lt;&lt;"The decimal equivalent of "&lt;&lt; bin&lt;&lt;" = "&lt;&lt;dec&lt;&lt;endl;
  
  return dec;
  }
  
  long int toOct(long int)
  {
  long int binnum, rem, quot;
  int octnum[100], i=1, j;
  cout&lt;&lt;"Enter the binary number: ";
  cin&gt;&gt;binnum;
  
  while(quot!=0)
  {
      octnum[i++]=quot%8;
      quot=quot/8;
  }
  
  cout&lt;&lt;"Equivalent octal value of "&lt;&lt;binnum&lt;&lt;" :"&lt;&lt;endl;
      for(j=i-1; j&gt;0; j--)
      {
          cout&lt;&lt;octnum[j];
      }
  
  }
  </code></pre>