OpenersNotesSection(Spacer1)Details

MLGetRealList() allocates memory for the array of numbers. You must call (NonWLLink[MLDisownRealList(), paclet:ref/c/MLDisownRealList]) to disown this memory. If MLGetRealList() fails and the function's return value indicates an error, do not call (NonWLLink[MLDisownRealList(), paclet:ref/c/MLDisownRealList]) on the contents of a.

MLGetRealList() returns immutable data.

MLGetRealList() returns 0 in the event of an error, and a nonzero value if the function succeeds.

Use (NonWLLink[MLError(), paclet:ref/c/MLError]) to retrieve the error code if MLGetRealList() fails.

MLGetRealList() is equivalent to (NonWLLink[MLGetReal64List(), paclet:ref/c/MLGetReal64List]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "mathlink.h"

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

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

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

	/* ... */

	MLDisownRealList(lp, list, length);
}

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Handling Lists, Arrays and Other Expressions, paclet:tutorial/HandlingListsArraysAndOtherExpressions])}})}})