You can pass the mpz_t variable as a parameter to your function rather than define it internally. The mpz_t type is set up to essentially pass by reference, so any modifications you make inside the function are also available outside it.
void primkereso(int bitszam, mpz_t prim){ ... mpz_out_str(stdout, 10, prim); } .... mpz_t prim; mpz_init(prim); primkereso(123, prim); Does this answer your question? Bill. On 26 October 2012 18:28, Richard Marton <y...@tekken.cc> wrote: > Hello! > > I wrote a void c++ function which uses the mpz_t type numbers and writes > it's output to stdout. > > void primkereso(int bitszam){ > > ... > > mpz_out_str(stdout, 10, prim); > } > > The problem is i want to store the prim variable outside of the custom > function. I have made and external mpz_t variable, and i want to > mpz_set(d,primkereso(16)); > Can i make this function return an mpz_t number? > > > > > I am trying to get the > > -- > You received this message because you are subscribed to the Google Groups > "mpir-devel" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/mpir-devel/-/vjZBNPGG0w0J. > To post to this group, send email to mpir-devel@googlegroups.com. > To unsubscribe from this group, send email to > mpir-devel+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/mpir-devel?hl=en. -- You received this message because you are subscribed to the Google Groups "mpir-devel" group. To post to this group, send email to mpir-devel@googlegroups.com. To unsubscribe from this group, send email to mpir-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/mpir-devel?hl=en.