|
SOLUTIONS
|
MATHEMATICA MATHLINK C FUNCTION
MLInitialize()
MLENV![]()
initializes the MathLink environment object and passes parameters in p.
DetailsDetails
- The MathLink environment object stores the global state of MathLink during the execution of a program.
- A program can install custom memory allocators using the parameters object p.
- An appropriate call to MLInitialize() is generated automatically when an external program is created from MathLink templates.
- Any external program that uses the MathLink library must call MLInitialize() before calling any other MathLink library functions.
- The MathLink environment functions as a factory to create link objects.
- MLInitialize() is declared in the MathLink header file mathlink.h.
ExamplesExamplesopen allclose all
Basic Examples (1)Basic Examples (1)
#include "mathlink.h"
int main(int argc, char **argv)
{
MLENV ep;
MLINK lp;
int error;
ep = MLInitialize((char *)0);
if(ep == (MLENV)0)
{ /* unable to initialize environment */ }
lp = MLOpenArgcArgv(ep, argv, argv + argc, &error);
if(lp == (MLINK)0 || error != MLEOK)
{ /* unable to create link */ }
/* ... */
MLClose(lp);
MLDeinitialize(ep);
return 0;
}
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
