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

int WSPutSymbol(WSLINK link,const char *s)
puts a symbol whose name is given by the character string s to the WSTP connection specified by link.

DetailsDetails

  • The character string must be terminated with a null byte, corresponding to 0 in C.
  • WSPutSymbol() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use WSError() to retrieve the error code if WSPutSymbol() fails.
  • WSPutSymbol() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

/* send the expression Integrate[Sin[x],x] to a link */

void f(WSINK lp)
{
    if(! WSPutFunction(lp, "Integrate", 2))
        { /* unable to put the function to lp */ }

    if(! WSPutFunction(lp, "Sin", 1))
        { /* unable to put the function to lp */ }

    if(! WSPutSymbol(lp, "x"))
        { /* unable to put the symbol to lp */ }

    if(! WSPutSymbol(lp, "x"))
        { /* unable to put the symbol to lp */ }

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

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