| [Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | 
Copy a null-terminated string
Source position: syspchh.inc line 19
function strcopy(  | 
dest: pchar;  | 
source: pchar  | 
):pchar; overload;  | 
Dest: PWideChar;  | 
Source: PWideChar  | 
):PWideChar; overload;  | 
Copy the null terminated string in Source to Dest, and returns a pointer to Dest. Dest needs enough room to contain Source, i.e. StrLen(Source)+1 bytes.
No length checking is performed.
  | 
Copy an ansistring to a null-terminated string.  | 
|
  | 
Copy a null-terminated string, limited in length.  | 
|
  | 
Copy a null-terminated string, return a pointer to the end.  | 
Program Example4; Uses strings; { Program to demonstrate the StrCopy function. } Const P : PCHar = 'This is a PCHAR string.'; var PP : PChar; begin PP:=StrAlloc(Strlen(P)+1); STrCopy (PP,P); If StrComp (PP,P)<>0 then Writeln ('Oh-oh problems...') else Writeln ('All is well : PP=',PP); StrDispose(PP); end.