To initialize a GMP integer from a string in C ++, you can use libgmp++and use the constructor directly:
#include <gmpxx.h>
const std::string my_number = "12345678901234567890";
mpz_class n(my_number);
If you still need the raw type mpz_t, let's say n.get_mpz_t().
In C, you should write it like this:
#include <gmp.h>
const char * const my_number = "12345678901234567890";
int err;
mpz_t n;
mpz_init(n);
err = mpz_set_str(n, my_number);
mpz_clear(n);
See the documentation for further ways to initialize integers.