title: Invalid types 'long int[long int]' for array subscript
body: <p>I'm currently writing a  binary/decimal converter, and am getting stuck on a few errors. I need some help fixing them.</p>
  
  <p>error 1:</p>
  
  <pre><code>assignment 1.c:10:23: error: invalid types 'long int[long int]' for array subscript
   scanf("%ld",&amp;num[i]);
  </code></pre>
  
  <p>error 2:</p>
  
  <pre><code>assignment 1.c:11:11: error: invalid types 'long int[int]' for array subscript
  if(num[0]==0){
  </code></pre>
  
  <p>error 3:</p>
  
  <pre><code>assignment 1.c:20:11: error: invalid types 'long int[int]' for array subscript
  if(num[0]==1){
  </code></pre>
  
  <p>I'm not sure what the problem is with them, I might be making an obvious mistake.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main(){
  
    long int num,decimalNumber=0,j=1,remainder,i;
    int bord;
  
  
    printf("Enter any number any binary number: ");
    scanf("%ld",&amp;num[i]); 
    if(num[0]==0){
  
      while(num!=0){
        remainder=num%10;
        decimalNumber=decimalNumber+remainder*j;
        j=j*2;
        num=num/10;
      }
    }
    if(num[0]==1){
      printf("Press '1' for binary\n Press '2' for deciaml");
    }
  
    printf("Equivalent decimal value: %ld",decimalNumber);
  
    return 0;
  }
  </code></pre>
  
  <p>The program is not finished.</p>