OpenersNotesSection(Spacer1)Details

WSGetRealList() allocates memory for the array of numbers. You must call WSDisownRealList() to disown this memory. If WSGetRealList() fails and the function's return value indicates an error, do not call WSDisownRealList() on the contents of a.

WSGetRealList() returns immutable data.

WSGetRealList() 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 WSGetRealList() fails.

WSGetRealList() is equivalent to (NonWLLink[WSGetReal64List(), paclet:ref/c/WSGetReal64List]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

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

void f(WSLINK lp)
{
	double *list;
	long length;

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

	/* ... */

	WSDisownRealList(lp, list, length);
}

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Handling Lists, Arrays and Other Expressions, paclet:tutorial/HandlingListsArraysAndOtherExpressions])}, {▪(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])}})}})