WSPutByteArray (C 函数)
int WSPutByteArray(WSLINK link,unsigned char *a,int *dims,char **heads,int d)
把范围在0–255的整数数组放在由 link 指定的 WSTP 连接中形成深度为 d,维数为 dims 的数组.
范例
基本范例 (1)
#include "wstp.h"
/* send a list of integers in the range 0-255 to a link */
void f(WSLINK lp)
{
unsigned char array[10][5][3][4];
long dims[4];
int i;
for(i = 0; i < 600; i++)
*((unsigned char *)array + i) = i;
dims[0] = 10;
dims[1] = 5;
dims[2] = 3;
dims[3] = 4;
if(! WSPutByteArray(lp, (unsigned char *)array, (long *)dims, (char **)0, 4))
{ /* unable to send array of integers to lp */ }
}