Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » UltraLite - C 及 C++ 编程 » API 参考 » UltraLite C++ API 参考 » ULValue 类

 

GetStringLength 函数

获取字符串的长度。

语法
size_t ULValue::GetStringLength(
  bool fetch_as_chars
)
参数
  • fetch_as_chars   对于字节,长度为 false;对于字符,长度为 true。

返回值

保存由GetString 函数方法之一返回的字符串所需的字节数或字符数(不包括空终止符)。

示例

预期的用法如下:

          len = v.GetStringLength();
          dst = new char[ len + 1 ];
          ( dst, len + 1 ); GetString

对于宽字符应用程序,用法为:

          len = v.GetStringLength( true );
          dst = new ul_wchar[ len + 1 ];
          ( dst, len + 1 ); GetString