WSReleaseUCS2String (C Function)

void WSReleaseUCS2String(WSLINK link,unsigned short *s,int n)

disowns memory allocated by WSGetUCS2String() to store the string s.

Details

  • WSReleaseUCS2String() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include "wstp.h"

/* read a UCS-2 encoding string from a link and then release the memory to WSTP for deallocation */

void f(WSLINK lp)
{
    unsigned short *string;
    int length;

    if(! WSGetUCS2String(lp, &string, &length))
        { /* unable to read the UCS-2 string */ }

    /* ... */

    WSReleaseUCS2String(lp, string, length);
}