home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / wcsset.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  1KB  |  50 lines

  1. /***
  2. *wcsset.c - sets all characters of wchar_t string to given character
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       defines _wcsset() - sets all of the characters in a string (except
  8. *       the L'\0') equal to a given character (wide-characters).
  9. *
  10. *******************************************************************************/
  11.  
  12.  
  13. #include <cruntime.h>
  14. #include <string.h>
  15.  
  16. /***
  17. *wchar_t *_wcsset(string, val) - sets all of string to val (wide-characters)
  18. *
  19. *Purpose:
  20. *       Sets all of wchar_t characters in string (except the terminating '/0'
  21. *       character) equal to val (wide-characters).
  22. *
  23. *
  24. *Entry:
  25. *       wchar_t *string - string to modify
  26. *       wchar_t val - value to fill string with
  27. *
  28. *Exit:
  29. *       returns string -- now filled with val's
  30. *
  31. *Uses:
  32. *
  33. *Exceptions:
  34. *
  35. *******************************************************************************/
  36.  
  37. wchar_t * __cdecl _wcsset (
  38.         wchar_t * string,
  39.         wchar_t val
  40.         )
  41. {
  42.         wchar_t *start = string;
  43.  
  44.         while (*string)
  45.                 *string++ = (wchar_t)val;
  46.  
  47.         return(start);
  48. }
  49.  
  50.