2.1.2.27 lstrcpy

Description

The lstrcpy (alias strcpy) function copies a string to a buffer.

Syntax

LPSTR lstrcpy( LPSTR lpString1, LPCSTR lpString2 )

Parameters

lpString1
[modify]Pointer to the destination 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
[input]Pointer to the null-terminated source string to be copied.

Return

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

Examples

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");
}
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.1565021425485611, "perplexity": 20369.99951452776}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882570793.14/warc/CC-MAIN-20220808092125-20220808122125-00742.warc.gz"}