MLPutData has been replaced by WSPutData.

int MLPutData(MLINK link,const char*b,int count)

puts count bytes from the buffer b to the MathLink connection specified by link.


  • MLPutData() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use MLError() to retrieve the error code if MLPutData() fails.
  • MLPutData() is declared in the MathLink header file mathlink.h.


Basic Examples  (1)

#include <string.h>
#include "mathlink.h"

/* send "Hello World!" to a link */

void f(MLINK lp)
    if(! MLPutNext(lp, MLTKSTR))
        { /* unable to put type MLTKSTR to lp */ }

    if(! MLPutSize(lp, strlen("Hello World!"))
        { /* unable to put the length of "Hello World!" to lp */ }

    if(! MLPutData(lp, "Hello World!", strlen("Hello World!")))
        { /* unable to put the data "Hello World!" to lp */ }

See Also

MLPutType()  MLPutArgCount()  MLPutSize()