title: Error: Expected expression before structure
body: <p>I am trying to return a pointer to a structure but I keep getting this weird error <code>bboard.c:35: error: Expecte expression before 'BBoard'</code> Does anyone have any ideas on to what could be causing this. I fairly new in c so my apologies of this is a trivial question.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  #include "bboard.h"
  
  struct BBoard {
  int create[MAX_ROWS][MAX_COLS];
  };
  
  
  BBoard * bb_create(int nrows, int ncols){
  int i,j;
  srand(time(NULL));
  struct BBoard Bboard;
  for (i = 0; i &lt; nrows; i++){
      for (j = 0; j &lt; ncols; j++){
          int r = rand() % 4;
          //printf("%d",r);
  
          if( r == 0){ 
          Bboard.create[i][j] = 1;}
          if(r == 1){
          Bboard.create[i][j] = 2;}
          if(r == 2){ 
          Bboard.create[i][j] = 3;}
          if(r == 3){
          Bboard.create[i][j] = 4;}
          printf(" %d ",Bboard.create[i][j]);
              }
          printf("\n");
          }
  struct BBoard *boardPtr = malloc(sizeof(struct BBoard));
  if (boardPtr != NULL){
  //printf("%d",boardPtr-&gt;create[1][1]);
  return BBoard *boardPtr;
  }
  else{
  printf("Error");
  }
  }
  
  /**extern void bb_display(BBoard *b){
  int i,j;
  BBoard Bboard = b;
  for (i = 0; i &lt; 5; i++){
      for (j = 0; j &lt; 5; j++){
          printf("%d",Bboard.create[i][j]);
          }
      }
  }**/
  
  
  int main(){
  BBoard *bptr;
  bptr = bb_create(5,5);
  //printf("%d",bptr-&gt;create[0][1]);
  }
  </code></pre>