WSGetReal32List()
This feature is not supported on the Wolfram Cloud.

int WSGetReal32List(WSLINK link,float **a,int *n)
gets a list of single-precision floating-point numbers from the WSTP connection specified by link, storing the numbers in the array a and the length of the list in n.

DetailsDetails

  • WSGetReal32List() allocates memory for the array of numbers. You must call WSReleaseReal32List() to disown this memory. If WSGetReal32List() fails and the function's return value indicates an error, do not call WSReleaseReal32List() on the contents of a.
  • External programs should not modify the array generated by WSGetReal32List().
  • WSGetReal32List() returns immutable data.
  • WSGetReal32List() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use WSError() to retrieve the error code if WSGetReal32List() fails.
  • WSGetReal32List() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

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

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

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

    /* ... */

    WSReleaseReal32List(lp, list, length);
}