|
SOLUTIONS
|
MATHEMATICA MATHLINK C FUNCTION
MLPutByteSymbol()
int MLPutByteSymbol(MLINK link, const unsigned char *s, long l)
puts a symbol whose name is given by the character string s of length l to the MathLink connection specified by link.
DetailsDetails
- MLPutByteSymbol() can transfer the full range of characters representable in 8 bits.
- The character string does not need to be terminated with a null byte.
- MLPutByteSymbol() returns 0 in the event of an error, and a nonzero value if the function succeeds.
- Use MLError() to retrieve the error code if MLPutByteSymbol() fails.
- MLPutByteSymbol() is declared in the MathLink header file mathlink.h.
ExamplesExamplesopen allclose all
Basic Examples (1)Basic Examples (1)
#include "mathlink.h"
/* send the expression Integrate[Cos[y],y] to a link */
void f(MLINK lp)
{
if(! MLPutFunction(lp, "Integrate", 2))
{ /* unable to put the function to lp */ }
if(! MLPutFunction(lp, "Cos", 1))
{ /* unable to put the function to lp */ }
if(! MLPutByteSymbol(lp, "y", 1))
{ /* unable to put the symbol to lp */ }
if(! MLPutByteSymbol(lp, "y", 1))
{ /* 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 »
