Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I'm using "mathlink.h" to call Mathematica from a C program. I send a computation to Mathematica and its return result is a very big number (100 digits). Hence, I want to read that number as a string.
How can I do it using MathLink?
You could simply wrap your computation in
MLPutFunction(link, "ToString", 1);
and convert your result to a string. After that you can use MLGetString.
ToString[x^2 + x + 1, InputForm]
Required, but never shown