title: Im using gmp in C and next prime isnt working? Im trying to generate rsa keys
body: <pre><code>mpz_t rand1,rand2;
  mpz_init (rand1);
  mpz_init (rand2);
  
  mpz_random (rand1,512);
  //mpz_random (rand2,512);
  
  mpz_nextprime ( rand2, rand1 );
  gmp_printf("random %Zd\n", rand2);
  //free the big ints
  mpz_clear(rand1);
  mpz_clear(rand2);
  </code></pre>
  
  <p>However is i print after random it works but the second i call next prime nothing prints out?</p>