WSReleaseUCS2String (C 函数)

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

释放由 WSGetUCS2String() 分配的存储字符串 s 的内存.

更多信息

  • WSTP 的标头文件 wstp.h 已对 WSReleaseUCS2String() 作出声明.

范例

基本范例  (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);
}