WSPutInteger16List (C Function)

int WSPutInteger16List(WSLINK link,const short *a,int n)

puts a list of 16-bit integers starting from location to the WSTP connection specified by .


  • WSPutInteger16List() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use WSError() to retrieve the error code if WSPutInteger16List() fails.
  • WSPutInteger16List() is declared in the WSTP header file wstp.h.


Basic Examples  (1)

#include "wstp.h"

/* send a one-dimensional list of 16-bit integers to a link */

void f(WSLINK lp)
    short list[10], i;

    for(i = 0; i < 10; i++)
        list[i] = i;

    if(! WSPutInteger16List(lp, (short *)list, 10))
        { /* unable to send the list to lp */ }