Name

wcsrev - reverts the wide-character string.

Library

libc.lib

Synopsis

  #include <wchar.h>
  wchar_t* wcsrev (wchar_t *wcs);

Detailed description

The wcsrev() function reverses the order of the characters in the wide-character string wcs. The terminating null character remains in place.The arguments and return value of wcsrev are wide-character strings; It returns a pointer to the altered string. the pointer returned is the same as the pointer passed as the input argument.

Return values

The wcsrev() returns a pointer to the reverted string, on success, else it returns NULL pointer.

Examples

#include <wchar.h>
/* Illustrates how to use wcsrev API */
int example_wcsrev(void)
{ 
  /* input string which needs to be reverted. */
  wchar_t src[9]=L"kohinoor";
 
  /* expected result string */
  wchar_t *exp=L"roonihok";
 
  wchar_t *res = NULL;
    
  /* function call to revert the src */
  res = wcsrev(src);
  /* compare res string with exp string, if they are equal then return 0, else return -1 */
  if( res != NULL && !wcscmp(res,exp))
        return 0;
  else
        return -1;
}

         


See also

strrev

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top