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


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

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

void f(MLINK lp)
    float *list;
    int length;

    if(! MLGetReal32List(lp, &list, &length))
            /* unable to read the list of numbers from lp */

    /* ... */

    MLReleaseReal32List(lp, list, length);