Share this page

# strcpy

String Manipulation Functions

Copies one string to another.

    char *strcpy( char *dest, const char *source);

dest | The destination string into which source is copied.
source | The string that is copied.

## Return Values

Returns the destination string.

## Example

The following example uses strcpy to copy the string "c:\\tmp" to the character array fullpath.

The example then appends a backslash and filename to fullpath.

        #include <string.h>

        char fullpath[1024], * filename = "logfile.txt";
        strcpy(fullpath, "c:\\tmp");
        lr_output_message ("fullpath after strcpy: %s", fullpath);
        strcat(fullpath, "\\");
        strcat(fullpath, filename);
        lr_output_message ("Full path of file is %s", fullpath);}

    Example: Output:
    Action.c(6): fullpath after strcpy: c:\tmp
    Action.c(10): Full path of file is c:\tmp\logfile.txt

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: