|
SOLUTIONS
|
MLPutUTF8String()
int MLPutUTF8String(MLINK link, const unsigned char *s, int len)
len バイトのUTF-8文字列s をlink で指定されたMathLink 接続に置く.
詳細詳細
- MLPutUTF8String()は,文字列s の文字数を自動的に測定する.
- MLPutUTF8String()はエラーがあると0を返し,関数が成功すると0以外の値を返す.
- MLError()を使うと,MLPutUTF8String()が不成功の場合にエラーコードを引き出すことができる.
- MLPutUTF8String()はMathLink ヘッダファイルmathlink.hの中で宣言される.
例題例題すべて開くすべて閉じる
例 (1)例 (1)
#include "mathlink.h"
/* send an Integrate[] expression to a link */
void f(MLINK lp)
{
unsigned char *expr = "Integrate[1/Sin[x],x]";
if(! MLPutFunction(lp, "EvaluatePacket", 1))
{ /* unable to send the function to lp */ }
if(! MLPutFunction(lp, "ToExpression", 1))
{ /* unable to send the function to lp */ }
if(! MLPutUTF8String(lp, (const unsigned char *)expr, 21))
{ /* unable to send the expression to lp */ }
if(! MLEndPacket(lp))
{ /* unable to send the end-of-packet indicator to lp */ }
if(! MLFlush(lp))
{ /* unable to flush any buffered outgoing data to lp */ }
}
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
