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

int WSPutInteger8((WSLINK l, unsigned char i)
puts the 8-bit integer i to the WSTP connection specified by l.

DetailsDetails

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

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "mathlink"

/* A function to send the expression Plus[3,126] to a link */

void f(MLINK l)
{
    unsigned char a = 3;
    unsigned char b = 126;

    if(! WSPutFunction(l, "Plus", 2))
    { /* Unable to put the function to the link */ }

    if(! WSPutInteger8(l, a))
    { /* Unable to put the integer 3 to the link */ }

    if(! WSPutInteger8(l, b))
    { /* Unable to put the integer 126 to the link */ }

    if(! WSEndPacket(l))
    { /* Unable to send the end-of-packet indicator to the link */ }

    if(! WSFlush(l))
    { /* Unable to flush the outgoing data to the link */ }
}