MLPutInteger32Array (C 函数)
MLPutInteger32Array 已经被 WSPutInteger32Array 所取代.
int MLPutInteger32Array(MLINK link,int *a,int *dims,char **heads,int d)
把一32位整数数组写入由 link 指定的 MathLink 连接中形成深度为 d,维数为 dims 的数组.
更多信息

- 数组 a 在内存中的布局必须像一个被明确声明为
的 C 数组.
- 如果 heads 为 NULL,那么数组将被假设为在每层中具有标头 List.
- 在 i 层的数组长度为
.
- MLPutInteger32Array() 在错误事件中返回0,如果函数成功则返回非零值.
- 如果 MLPutInteger32Array() 失败,则使用 MLError() 检索错误代码.
- MLPutInteger32Array() 在 MathLink 标头文件 mathlink.h 中被声明.
范例
基本范例 (1)
#include "mathlink.h"
/* send an array of 32-bit integers to a link */
void f(MLINK 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(! MLPutInteger32Array(lp, (int *)array, (int *)dims, (char **)0, 4))
{ /* unable to send the array to lp */ }
}