MLPutRealNumberAsUTF8String (C 関数)
MLPutRealNumberAsUTF8StringはWSPutRealNumberAsUTF8Stringに置き換えられた.
int MLPutRealNumberAsUTF8String(MLINK l, const unsigned char *s, int n)
長さ n のUTF-8の文字列 s としてコード化された浮動小数点数を,l が指定するMathLink接続に送信する.
詳細

- 数 s を"3.14159"の形式で送信する.
- MLPutRealNumberAsUTF8String()は,エラーの場合には0を,関数が成功した場合には非零の値を返す.
- MLPutRealNumberAsUTF8String()は,MathLinkヘッダファイルmathlink.hで宣言される.
例題
例 (1)
#include "mathlink.h"
/* A function to put the expression Sqrt[2.75] to a link */
void f(MLINK l)
{
unsigned char *theNumber[4];
theNumber[0] = '2';
theNumber[1] = '.';
theNumber[2] = '7';
theNumber[3] = '5';
if(! MLPutFunction(l, "Sqrt", 1))
{ /* Unable to put Sqrt[] to the link */ }
if(! MLPutRealNumberAsUTF8String(l, theNumber, 4))
{ /* Unable to put the number to the link */}
if(! MLEndPacket(l))
{ /* Unable to put the end-of-packet sequence to l */ }
if(! MLFlush(l))
{ /* Unable to flush any output buffered in l */ }
}