OpenersNotesSection(Spacer1)Details

The array a must be laid out in memory like a C array declared explicitly as int a[m][n]….

If heads is given as NULL, the array will be assumed to have head (RefLink[List, paclet:ref/List]) at every level.

The length of the array at level i is taken to be dims[i].

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

WSPutInteger32Array() 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"

/* send an array of 32-bit integers to a link */

void f(WSLINK lp)
{
	int array[6][10][2][1];
	int dims[4];
	int i;

	for(i = 0; i < 120; i++)
		*((int *)array + i) = i;

	dims[0] = 6;
	dims[1] = 10;
	dims[2] = 2;
	dims[3] = 1;

	if(! WSPutInteger32Array(lp, (int *)array, (int *)dims, (char **)0, 4))
		{ /* unable to send the array to lp */ }
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSPutInteger16Array(), paclet:ref/c/WSPutInteger16Array])  ▪  (NonWLLink[WSPutInteger64Array(), paclet:ref/c/WSPutInteger64Array])}})}})

({{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 Integers, paclet:guide/WSTPCFunctionsForExchangingIntegers])}, {▪(RefLinkPlain[WSTP C Functions for Exchanging Multidimensional Arrays, paclet:guide/WSTPCFunctionsForExchangingMultidimensionalArrays])}})}})