RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.StrLCopy Function

Copies up to a specified maximum number of characters from Source to Dest.

Pascal
function StrLCopy(Dest: PChar; const Source: PChar; MaxLen: Cardinal): PChar;
C++
const char * StrLCopy(const char * Dest, const const char * Source, unsigned MaxLen);

SysUtils

StrLCopy copies at most MaxLen characters from Source to Dest, then adds a null terminator to Dest and returns Dest. The SizeOf standard function (Delphi) or the sizeof operator (C++) can be used to determine the MaxLen parameter. Usually MaxLen equals SizeOf(Dest)-1.

Note: StrLCopy copies a null terminator as well as MaxLen characters. Be sure that Dest is large enough to accommodate the null terminator at the end.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!