title: expected expression before "[" token
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()  
  {
      int i,j;
      double xcord[201], ycord[201];
      double *a,*b;
      float delx,dely;
  
      double *phi = (double *)malloc(201 *201* sizeof(double));
      double *r = (double *)malloc(201 *201* sizeof(double));
  
      delx=0.005;
  
      dely=0.005;
      a=xcord;
      b=xcord;
  
      for(i=1;i&lt;=201;i++)//grid generation
      {
          xcord[i]=-0.5+0.005*(i-1);
          ycord[i]=-0.5+0.005*(i-1);
      }
      for(i=1;i&lt;=201;i++)
      {   
          for(j=1;j&lt;=201;j++)
          { 
              printf("%f %f\n",xcord[i],ycord[j]);
          }
      }
      for(i=1;i&lt;=201;i++)//phi value calculation
      {   
          for(j=1;j&lt;=201;j++)
          {   
          /* Next 2 lines are highlighted */ 
              *(r + (i-1)*201+ (j-1))=1500*[{(*(a+(i-1))+0.25)*(*(a+(i-1))+0.25)}+{(*(b+(j-1)))*(*(b+(j-1)))};
              *(phi + (i-1)*201+ (j-1))=5*exp (*(r + (i-1)*201+ (j-1)));
          }
      }
      for(i=1;i&lt;=201;i++)
      {   
          for(j=1;j&lt;=201;j++)
          { 
              printf("%f \n",*(phi + (i-1)*201+ (j-1)));
          }
      }
      return 0;
  }
  </code></pre>
  
  <p>This the code I am writing to generate a computational grid and afterwards to calculate the value of variable <code>phi</code> at each node of the grid. I am trying to put the equation of <code>phi (=5exp[-1500{(x+0.25)*(x+0.25)+y*y}])</code> in the two line highlighted. But each time I compile I get an error "expected expression before <code>[</code> token in the line 34.</p>