| mpfr_libmpfr_asprintf Method  | 
 
            Write output as a null terminated string in a block of memory allocated using the allocation function (see 
GNU MPFR - Memory Handling).
            
 
    Namespace: 
   Math.Mpfr.Native
    Assembly:
   Math.Mpfr.Native (in Math.Mpfr.Native.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic static int mpfr_asprintf(
	ptr<char_ptr> str,
	string template,
	params Object[] arguments
)
Public Shared Function mpfr_asprintf ( 
	str As ptr(Of char_ptr),
	template As String,
	ParamArray arguments As Object()
) As Integer
public:
static int mpfr_asprintf(
	ptr<char_ptr>^ str, 
	String^ template, 
	... array<Object^>^ arguments
)
static member mpfr_asprintf : 
        str : ptr<char_ptr> * 
        template : string * 
        arguments : Object[] -> int 
Parameters
- str
 - Type: Math.Gmp.Nativeptrchar_ptr
The output string. - template
 - Type: SystemString
Format string. See Formatted Output Functions. - arguments
 - Type: SystemObject
Arguments. 
Return Value
Type: 
Int32The return value is the number of characters written in the string, excluding the null-terminator, or a negative value if an error occurred, in which case the contents of 
str are undefined.
Remarks
            A pointer to the block is stored in str. The block of memory must be freed using mpfr_free_str.
            
Examples
ptr<char_ptr> str = new ptr<char_ptr>();
mpfr_t r = "12345e6";
Assert.IsTrue(mpfr_lib.mpfr_asprintf(str, "%Re", r) == 10);
Assert.IsTrue(str.Value.ToString() == "1.2345e+10");
gmp_lib.free(str.Value);
Dim str As ptr(Of char_ptr) =  New ptr(Of char_ptr)()
Dim r As mpfr_t = "12345e6"
Assert.IsTrue(mpfr_lib.mpfr_asprintf(str, "%Re", r) = 10)
Assert.IsTrue(str.Value.ToString() = "1.2345e+10")
gmp_lib.free(str.Value)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also