home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 1.ddi / CLIBSRC1.ZIP / STPCPY.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.3 KB  |  48 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - stpcpy.c
  3.  *
  4.  * function(s)
  5.  *        stpcpy - copies one string to another
  6.  *-----------------------------------------------------------------------*/
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 5.0
  10.  *
  11.  *      Copyright (c) 1987, 1992 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16.  
  17. #include <string.h>
  18.  
  19. /*---------------------------------------------------------------------*
  20.  
  21. Name            stpcpy - copies one string to another
  22.  
  23. Usage           char *stpcpy(char *destin, const char *source)
  24.  
  25. Prototype in    string.h
  26.  
  27. Description     stpcpy copies the bytes of source into destin and stops after
  28.                 copying the terminating null character of source. stpcpy (a, b)
  29.                 is the same as strcpy (a, b) except that the return values
  30.                 differ.
  31.  
  32.                 strcpy(a, b) returns a, while stpcpy (a, b) returns a +
  33.                 strlen (b).
  34.  
  35. Return value    returns destin + strlen(source);
  36.  
  37. *---------------------------------------------------------------------*/
  38. #undef stpcpy                  /* not an intrinsic */
  39.  
  40. char _FAR * _CType stpcpy(char _FAR *to, const char _FAR *from)
  41. {
  42.     register unsigned len;
  43.  
  44.     len = strlen(from);
  45.     memcpy(to, from, len+1);
  46.     return (to+len);
  47. }
  48.