ReactOS 0.4.16-dev-835-gd769f56
strncnt.cpp
Go to the documentation of this file.
1//
2// strncnt.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// Defines __strncnt(), 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 __strncnt(
14 char const* const string,
15 size_t const count
16 )
17{
18 char 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 __strncnt(char const *const string, size_t const count)
Definition: strncnt.cpp:13