help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Procedures and functions] Reference for unit 'strings' (#rtl)

strpcopy

Copy a pascal string to a null-terminated string

Declaration

Source position: strings.pp line 24

function strpcopy(

  d: pchar;

  const s: String

):pchar;

Description

Converts the Pascal string in Source to a Null-terminated string, and copies it to Dest. Dest needs enough room to contain the string Source, i.e. Length(Source)+1 bytes.

Errors

No length checking is performed.

See also

StrPas

  

Convert a null-terminated string to a shortstring.

Example

Program Example2;

Uses strings;

{ Program to demonstrate the StrPCopy function. }

Const S = 'This is a normal string.';

Var P : Pchar;

begin
  p:=StrAlloc (length(S)+1);
  if StrPCopy (P,S)<>P then
    Writeln ('This is impossible !!')
  else
    writeln (P);
  StrDispose(P);  
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505