Mathematica > Systems Interfaces & Deployment > C/C++ Language Interface > MathLink C Language Functions >
Mathematica > Systems Interfaces & Deployment > MathLink API > MathLink C Language Functions >
MathLink C Function

MLGetReal64List()

int MLGetReal64List(MLINK link, double **a, int *n)
gets a list of double-precision floating-point numbers from the MathLink connection specified by link, storing the numbers in array a and the length of the list in n.
  • MLGetReal64List() allocates memory for the array of numbers. You must call MLReleaseReal64List() to disown this memory. If MLGetReal64List() fails and the function's return value indicates an error, do not call MLReleaseReal64List() on the contents of a.
  • MLGetReal64List() returns immutable data.
  • MLGetReal64List() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use MLError() to retrieve the error code if MLGetReal64List() fails.
  • MLGetReal64List() is declared in the MathLink header file mathlink.h.
#include "mathlink.h"

/* read a list of double-precision floating-point numbers from a link */

void f(MLINK lp)
{
    double *list;
    int length;

    if(! MLGetReal64List(lp, &list, &length))
        {
            /* unable to read the list of numbers from lp */
            return;
        }

    /* ... */

    MLReleaseReal64List(lp, list, length);
}
© 2008 Wolfram Research, Inc.
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team