|
SOLUTIONS
|
MATHEMATICA MATHLINK C FUNCTION
MLNewParameters()
initializes an MLParameters object p and sets the MathLink revision number to the value specified by rev, and the MathLink API revision number to the value specified by apirev.
DetailsDetails
- The MathLink revision number and the MathLink API revision number should be set to the the constants MLREVISION and MLAPIREVISION from mathlink.h.
- MLNewParameters() does not allocate memory for the MLParameters object p.
- MLNewParameters() returns rev on success or 0 if an error occurs.
- MLNewParameters() is declared in the MathLink header file mathlink.h.
ExamplesExamplesopen allclose all
Basic Examples (1)Basic Examples (1)
#include <stdlib.h>
#include "mathlink.h"
/* initialize the MathLink environment */
MLENV f(void)
{
MLENV env;
MLParameters p;
unsigned long res;
if(! MLNewParameters((char *)p, MLREVISION, MLAPIREVISION))
{ /* unable to initialize the parameters object */ }
MLSetAllocParameter((char *)p, malloc, free);
env = MLInitialize((char *)p);
if(env == (MLENV)0)
{ /* unable to initialize the MathLink environment */ }
return env;
}
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
