This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
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);
}