Invalid types float[int] for array subscript
<p>I had been doing a question. I have not written the function code here because  I am getting an error:</p>

<blockquote>
  <p>invalid types float[int] for array subscript in the following code snippet. </p>
</blockquote>

<p>Please tell me why is this <code>error</code> coming?</p>

<pre><code>#include&lt;iostream&gt;
using namespace std;
main()
{
    float a,b,p,q,r,s,arr[1000];
    int n=1000, minOp;

  cin&gt;&gt;a;
  cin&gt;&gt;b;
  cin&gt;&gt;p&gt;&gt;q&gt;&gt;r&gt;&gt;s;
  arr[0]=src;
  for(int i=1; i&lt;n; i++)
  {
      if( i%4==1)
      {
          a[i]=a[i/4] + p;
      }
      else if( i%4==2)
      {
          a[i]=a[i/4] - q;
      }
      else
      if( i%4==3)
      {
          a[i]=a[i/4] * r;
      }
      else if( i%4==0)
      {

          a[i]= a[ (i/4)-1] / s;
      }
    }

 root = buildTree( arr, n);
 minOp = bfs(root,b);
cout&lt;&lt;minOp;
}
</code></pre>

<p>Any help would be appreciated.</p>