strcpy

This macro copies a source string into a destination string. It writes the src string directly to the dest string address until it finds a NUL character '\0', which designates the end of the src string.

This macro behaves like the strcpy function in the ANSI C string library.

Syntax:

char *strcpy (dest, src)
char *
dest, *src;

where:

dest                      A character pointer, that specifies the starting address for the destination character string. Characters from the src string will be copied to the dest string location.

src                        A character pointer that specifies the starting address for the source character string. This string will be copied to the dest string location.

Return Value

char*                    Points to the first byte in the string dest.

Rules

If the destination string is a debugger array, the macro checks the size of the array before copying. Otherwise, the macro does not check to see whether the src string will fit into the dest array. Failure to allocate enough space for the dest array causes excess characters to overflow into adjacent memory locations. Consider using the strlen macro first to confirm that there is enough length in dest for the src string.