WSPutInteger16Array (C 函数)
int WSPutInteger16Array(WSLINK link,short *a,int *dims,char **heads,int d)
把一16位整数数组写入由 link 指定的 WSTP 连接中形成深度为 d,维数为 dims 的数组.
范例
基本范例 (1)
#include "wstp.h"
/* send an array of 16-bit integers to a link */
void f(WSLINK lp)
{
short array[6][10][2][1];
int dims[4];
int i;
for(i = 0; i < 120; i++)
*((short *)array + i) = i;
dims[0] = 6;
dims[1] = 10;
dims[2] = 2;
dims[3] = 1;
if(! WSPutInteger16Array(lp, (short *)array, (int *)dims, (char **)0, 4))
{ /* unable to put the array to lp */ }
}