The lstrcpy (alias strcpy) function copies a string to a buffer.
LPSTR lstrcpy( LPSTR lpString1, LPCSTR lpString2 )
If the function succeeds, the return value is a pointer to the destination buffer. If the function fails,the return value is NULL.
EX1
void lstrcpy_ex1() { char *ptr = NULL; char szStr[80]; string str1 = "Here is some text"; // Copy str1 to szStr: ptr = lstrcpy(szStr, str1); if(0 == strcmp(ptr, "Here is some text") ) printf(" after copy szStr is \"%s\" \n" , szStr); else printf("copy failed\n"); }
strcpy
origin.h