Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) Mpz_tToStr

 

Mpz_tToStr is a code snippet to convert a GMP mpz_t data type to a std::string.

 

#include <gmpxx.h>

///From http://www.richelbilderbeek.nl/CppMpz_tToStr.htm
const std::string Mpz_tToStr(const mpz_t& i)
{
  static char buffer[256];
  mpz_get_str(buffer,10,i);
  return std::string(buffer);
}

 

For full example, go to the 'Hello Gmp' page.

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml