RAD Studio
ContentsIndex
PreviousUpNext
_mbsnbcnt, _mbsnccnt, _strncnt, _wcsncnt

Header File 

mbstring.h 

Category 

Memory and String Manipulation Routines 

Prototype 

size_t _mbsnbcnt(const unsigned char * str, size_t nmbc); 

size_t _mbsnccnt(const unsigned char * str, size_t nbyte); 

Description 

If _MBCS is defined: 

_mbsnbcnt is mapped to the portable macro _tcsnbcnt 

_mbsnccnt is mapped to the portable macro _tcsnccnt If _UNICODE is defined: 

both _mbsnbcnt and _mbsnccnt are mapped to the _wcsncnt macro 

If neither _MBCS nor _UNICODE are defined. 

_tcsnbcnt and _tcsnccnt are mapped to the _strncnt macro _strncnt is the single-byte version of these functions. _wcsncnt is the wide-character version of these functions. 

_strncnt and _wcsncnt are available only for generic-text mappings. They should not be used directly. 

_mbsnbcnt examines the first nmbc multibyte characters of the str argument. The function returns the number of bytes found in the those characters. 

_mbsnccnt examines the first nmbc bytes of the str argument. The function returns the number of characters found in those bytes. If NULL is encountered in the second byte of a multibyte character, the whole character is considered NULL and will not be included in the return value. 

Each of the functions ends its examination of the str argument if NULL is reached before the specified number of characters or bytes is examined. 

If str has fewer than the specified number of characters or bytes, the function return the number of characters or bytes found in str. 

Return Value 

_mbsnbcnt returns the number of bytes found. 

_mbsnccnt returns the number of characters found. 

If nmbc or nbyte are less than zero, the functions return 0.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!