WSPutInteger32()
This feature is not supported on the Wolfram Cloud.

int WSPutInteger32(WSLINK link,int i)
puts the 32-bit integer i to the WSTP connection specified by link.

DetailsDetails

  • WSPutInteger32() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use WSError() to retrieve the error code if WSPutInteger32() fails.
  • You can send arbitrary-precision integers to the Wolfram Language by giving lists of digits, then converting them to numbers using FromDigits.
  • WSPutInteger32() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

/* send the expression Times[10,30] to a link */

void f(MLINK lp)
{
    if(! WSPutFunction(lp, "Times", 2))
        { /* unable to send the function to lp */ }

    if(! WSPutInteger32(lp, 10))
        { /* unable to send the integer to lp */ }

    if(! WSPutInteger32(lp, 30))
        { /* unable to send the integer to lp */ }

    if(! WSEndPacket(lp))
        { /* unable to send the end-of-packet sequence to lp */ }

    if(! WSFlush(lp))
        { /* unable flush any buffered outgoing data in lp */ }
}