|
SOLUTIONS
|
MLPutUCS2String()
int MLPutUCS2String(MLINK link, const unsigned short *s, int n)
n 個の16ビットのUCS-2 文字列を,link で指定されたMathLink 接続に置く.
詳細詳細
- すべての文字は,16ビットの文字であると想定される.
- 高次のバイトをヌルにすることによって,8バイトの文字を送信することができる.
- MLPutUCS2String()はエラーがあると0を返し,関数が成功すると0以外の値を返す.
- MLError()を使うと,MLPutUCS2String()が不成功の場合にエラーコードを引き出すことができる.
- MLPutUCS2String()はMathLink ヘッダファイルmathlink.hの中で宣言される.
例題例題すべて開くすべて閉じる
例 (1)例 (1)
#include "mathlink.h"
/* send the string "Hello World" to a link */
void f(MLINK lp)
{
unsigned short str[11];
str[0] = 'H';
str[1] = 'e';
str[2] = 'l';
str[3] = 'l';
str[4] = 'o';
str[5] = ' ';
str[6] = 'W';
str[7] = 'o';
str[8] = 'r';
str[9] = 'l';
str[10] = 'd';
if(! MLPutUCS2String(lp, (const unsigned short *)str, 11))
{ /* unable to put the string to lp */ }
}
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
