title: 2d arrays in recursion in c
body: <p>Well, This is the piece of code i wrote to print a matrix in spiral form in c. But it started showing me an error during compilation. i,basically, don't know how to write recursive functions properly. can someone fix the code ? please..
  the error in this code was that
  solution.c:23:1: error: expected identifier or '(' before '{' token
  can anyone tell me what that means...</p>
  
  <pre><code>     #include &lt;stdio.h&gt;
  
       matrix(int B[20][20],int M,int N);
  
       main() 
       {
       int M,N,j,i=1;
       scanf("%d %d",&amp;M,&amp;N);
      int B[M][N];
  
      for(i=1; i&lt;=M; i++)
      {
      for(j=1; j&lt;=N; j++)
      {
          scanf("%d",&amp;B[i][j]);
      }
      }
  
      matrix(B[20][20],M,N); 
      return 0; 
      }
      matrix(int B[20][20], int M,int N);
      {
      while(M!=0||N!=0)
      { 
      for (i=1,j=1; j&lt;=N; j++)
      {
          printf("%d ",(B[i][j]));
      } 
      for(i=2,j=N; i&lt;=M; i++)
      {
          printf("%d ",(B[i][j])); 
      }
      for(i=M,j=N-1; j&gt;0; j--)
      {
          printf("%d ",(B[i][j]));
      } 
      for(i=M-1,j=1; i&lt;=2; i--)
      {
          printf("%d ",(B[i][j])); 
      } 
     }
      matrix(B[20][20],--M,--N); 
     }
  </code></pre>