title: Storing GMP mpf_t and an mpz_t types in a file
body: <p>How do I save GMP objects of type mpf_t or mpz_t in a file in C ?
  Or how can I access the blocks of allocated memory for these types so that I can write them directly to a file ?</p>
  
  <h3>Edit</h3>
  
  <pre><code>fwrite(&amp;gmp_obj-&gt;_mp_size, sizeof(long), 1, fout);
  fwrite(&amp;gmp_obj-&gt;_mp_prec, sizeof(long), 1, fout);
  fwrite(&amp;gmp_obj-&gt;_mp_exp, sizeof(long), 1, fout);
  fwrite(gmp_obj-&gt;_mp_d, sizeof(long), gmp_obj-&gt;_mp_size, fout);
  </code></pre>