ReactOS 0.4.16-dev-927-g467dec4
wcsrev.cpp
Go to the documentation of this file.
1//
2// wcsrev.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// Defines _wcsrev(), which reverses a wide chraacter string in place. The
7// pointer to the string is returned.
8//
9#include <string.h>
10
11
12
13extern "C" wchar_t* __cdecl _wcsrev(wchar_t* const string)
14{
15 // Find the end of the string:
16 wchar_t* right = string;
17 while (*right++) { }
18 right -= 2;
19
20 // Reverse the strong:
21 wchar_t* left = string;
22 while (left < right)
23 {
24 wchar_t const c = *left;
25 *left++ = *right;
26 *right-- = c;
27 }
28
29 return string;
30}
#define __cdecl
Definition: accygwin.h:79
const GLubyte * c
Definition: glext.h:8905
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
#define c
Definition: ke_i.h:80
char string[160]
Definition: util.h:11
wchar_t *__cdecl _wcsrev(wchar_t *const string)
Definition: wcsrev.cpp:13