ReactOS 0.4.16-dev-814-g656a5dc
wcsncnt.cpp
Go to the documentation of this file.
1//
2// wcsncnt.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// Defines __wcsncnt(), which returns the number of characters in a string. If
7// the string is longer than the given 'count', 'count' is returned.
8//
9#include <string.h>
10
11
12
13extern "C" size_t __cdecl __wcsncnt(
14 wchar_t const* const string,
15 size_t const count
16 )
17{
18 wchar_t const* it = string;
19 size_t n = 0;
20
21 for (; *it && n != count; ++it, ++n) { }
22
23 return n;
24}
#define __cdecl
Definition: accygwin.h:79
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble n
Definition: glext.h:7729
char string[160]
Definition: util.h:11
size_t __cdecl __wcsncnt(wchar_t const *const string, size_t const count)
Definition: wcsncnt.cpp:13