WSReleaseByteString (C 函数)

void WSReleaseByteString(WSLINK link,const unsigned char *s,int n)

释放由 WSGetByteString () 分配的内存来存储字符代码为 s 的数组.

更多信息

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

范例

基本范例  (1)

#include "wstp.h"

/* read a string composed of character code values 0-255 from the link and release that memory to WSTP for deallocation */

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

    if(! WSGetByteString(lp, &string, &length, 0))
        { /* unable to read byte string from lp */ }

    /* ... */

    WSReleaseByteString(lp, string, length);
}