OpenersNotesSection(Spacer1)Details

WSGetReal32List() allocates memory for the array of numbers. You must call (NonWLLink[WSReleaseReal32List(), paclet:ref/c/WSReleaseReal32List]) to disown this memory. If WSGetReal32List() fails and the function's return value indicates an error, do not call (NonWLLink[WSReleaseReal32List(), paclet:ref/c/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 (NonWLLink[WSError(), paclet:ref/c/WSError]) to retrieve the error code if WSGetReal32List() fails.

WSGetReal32List() is declared in the WSTP header file (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

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

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

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

	/* ... */

	WSReleaseReal32List(lp, list, length);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSReleaseReal32List(), paclet:ref/c/WSReleaseReal32List])  ▪  (NonWLLink[WSGetReal64List(), paclet:ref/c/WSGetReal64List])  ▪  (NonWLLink[WSGetReal128List(), paclet:ref/c/WSGetReal128List])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Expressions in External Programs, paclet:tutorial/ManipulatingExpressionsInExternalPrograms])}, {▪(RefLinkPlain[Handling Lists, Arrays and Other Expressions, paclet:tutorial/HandlingListsArraysAndOtherExpressions])}, {▪(RefLinkPlain[Portability of WSTP Programs, paclet:tutorial/PortabilityOfWSTPPrograms])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}, {▪(RefLinkPlain[WSTP C Functions for Exchanging Lists, paclet:guide/WSTPCFunctionsForExchangingLists])}, {▪(RefLinkPlain[WSTP C Functions for Exchanging Reals, paclet:guide/WSTPCFunctionsForExchangingReals])}})}})