title: GMP mpz_array_init is an obsolete function - How should we initialize mpz arrays?
body: <p>Having only used the <a href="https://gmplib.org/index.html#dir" rel="noreferrer">GNU MP Bignum Library</a> a few times, I was interested to see that the way I had previously allocated/initiated arrays is now obsolete. From <a href="https://gmplib.org/manual/Integer-Special-Functions.html#Integer-Special-Functions" rel="noreferrer">Integer Special Functions</a>:</p>
  
  <blockquote>
    <p>5.16 Special Functions</p>
    
    <p>The functions in this section are for various special purposes. Most
    applications will not need them. — Function: void mpz_array_init
    (mpz_t integer_array, mp_size_t array_size, mp_size_t fixed_num_bits)</p>
  
  <pre><code>This is an obsolete function. Do not use it.
  </code></pre>
  </blockquote>
  
  <p>This is how I would allocate and initialze an array of <code>mpz_t</code>.</p>
  
  <pre><code>int array_size = 100;
  mpz_t *num_arr;
  num_arr = malloc(arr_size * sizeof(mpz_t));
  mpz_array_init(*num_arr, array_size, 1024);
  </code></pre>
  
  <p>This still works without and error or warning, btw, but now that this function is listed as obsolete, what is the proper way to allocate an array using GMP in C?</p>