lstrcpy

The lstrcpy function copies a string to a buffer.

LPTSTR lstrcpy(
  LPTSTR lpString1,  // pointer to buffer
  LPCTSTR lpString2  // pointer to string to copy
);
 

Parameters

lpString1
Pointer to a buffer to receive the contents of the string pointed to by the lpString2 parameter. The buffer must be large enough to contain the string, including the terminating null character.
lpString2
Pointer to the null-terminated string to be copied.

Return Values

If the function succeeds, the return value is a pointer to the buffer.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Remarks

With a double-byte character set (DBCS) version of the system, this function can be used to copy a DBCS string.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in winbase.h.
  Import Library: Use kernel32.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

String Manipulation Overview, String Manipulation Functions, lstrcat, lstrcmp, lstrcmpi, lstrlen