title: Static array allocation
body: <p>I have this implementation of alloc, which allocates memory as a dynamic array.</p>
  
  <p>My question is that what does it mean that the array and pointer are declared static? How does it affect to a function that calls alloc?</p>
  
  <pre><code>#define ALLOCSIZE 10000 /* size of available space */
  
  static char allocbuf[ALLOCSIZE];   /* storage for alloc */
  static char *allocp = allocbuf;    /* next free position */
  
  char *alloc(int n)   /* return pointer to n characters */
  {
  
      if (allocbuf + ALLOCSIZE - allocp &gt;= n) {  /* it fits */
          allocp += n;
          return allocp - n; /* old p */
      }  else               /* not enough room */
          return 0;
  }
  </code></pre>