title: Declaring a C function to return an array
body: <p>How can I make a function which returns an array? I tried this</p>
  
  <pre><code>const int WIDTH=11;
  const int HEIGHT=11;
  
  int main() {
    char A[WIDTH][HEIGHT];
    A=rand_grid(WIDTH,HEIGHT);
    return 0;
  }
  
  // Initializes a random board.
  char[][] rand_grid(int i, int k) {
    char* A[i][k];
    for(j=0;j&lt;i;++j) {
      for(l=0;l&lt;k;++l) {
        A[j][l]=ran(10);
      }
    }
    return A;
  }
  
  // Returns a random number from the set {0,...,9}.
  int ran(int i) {
    srand((unsigned int) time(0));
    return(rand()%10);
  }
  </code></pre>