title: Maximum Size of an Array in FLINT?
body: <p>I'm working on a project that uses the FLINT library, and I'm running into some problems defining a large fmpz array. Here's a minimal example of the problem</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fmpz_mod_poly.h&gt;
  #include &lt;fmpz_mod.h&gt;
  #include&lt;cstdlib&gt;
  #include&lt;array&gt;
  using namespace std;
  int main()
  {
      //Here k is 2^20, I just used a bit shift trick to calculate it quickly
      //This does not run, but for int k  = 1&lt;&lt;19 it does run.
      int k = 1&lt;&lt;20;
      fmpz TestArray[k];
      for(int i = 1; i&lt;=k;i++)
      {
          TestArray[i] = i;
      }
  return 0;
  </code></pre>
  <p>and the error code is
  Thread 1: EXC_BAD_ACCESS (code=2, address=0x7ff7bf6ffff8).</p>
  <p>If I replace the line</p>
  <pre><code>int k = 1 &lt;&lt; 20;
  </code></pre>
  <p>with the line</p>
  <pre><code>int k = 1&lt;&lt;19;
  </code></pre>
  <p>then the program compiles with no error. I'm not sure what the issue is. I was under the impression that there was no maximum array size in C++.</p>