next up previous contents index
Next: StrDispose Up: Functions and procedures. Previous: StrComp

StrCopy

   

Declaration:

Function StrCopy (Dest,Source : PChar) : PChar;

Description:

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.

Errors:

No length checking is performed.

See also:

StrPCopy, StrLCopy, StrECopy

Example
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);
end.



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998