|
SOLUTIONS
|
MLPutSymbol()
int MLPutSymbol(MLINK link, const char *s)
文字列s によってその名前を与えられる記号を,link で指定されたMathLink 接続に置く.
詳細詳細
- 文字列は,C言語の
に対応してヌルバイトで終らなければならない. - MLPutSymbol()はエラーがあると0を返し,関数が成功すると0以外の値を返す.
- MLError()を使うと, MLPutSymbol()が不成功の場合にエラーコードを引き出すことができる.
- MLPutSymbol()はMathLink ヘッダファイルmathlink.hの中で宣言される.
例題例題すべて開くすべて閉じる
例 (1)例 (1)
#include "mathlink.h"
/* send the expression Integrate[Sin[x],x] to a link */
void f(MLINK lp)
{
if(! MLPutFunction(lp, "Integrate", 2))
{ /* unable to put the function to lp */ }
if(! MLPutFunction(lp, "Sin", 1))
{ /* unable to put the function to lp */ }
if(! MLPutSymbol(lp, "x"))
{ /* unable to put the symbol to lp */ }
if(! MLPutSymbol(lp, "x"))
{ /* unable to put the symbol to lp */ }
if(! MLEndPacket(lp))
{ /* unable to send the end-of-packet indicator to lp */ }
if(! MLFlush(lp))
{ /* unable to flush any outgoing data buffered in lp */ }
}
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
