System.SysUtils.StrLCopy
De RAD Studio API Documentation
Delphi
function StrLCopy(Dest: PAnsiChar; const Source: PAnsiChar; MaxLen: Cardinal): PAnsiChar; function StrLCopy(Dest: PWideChar; const Source: PWideChar; MaxLen: Cardinal): PWideChar;
C++
extern DELPHI_PACKAGE char * __fastcall StrLCopy _DEPRECATED_ATTRIBUTE1("Moved to the AnsiStrings unit") (char * Dest, const char * Source, unsigned MaxLen)/* overload */;
Propriétés
| Type | Visibilité | Source | Unité | Parent |
|---|---|---|---|---|
| function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
Description
Copie de Source vers Dest un nombre de caractères au plus égal au maximum spécifié.
StrLCopy copie au plus MaxLen caractères de Source dans Dest, puis ajoute un caractère de terminaison null à Dest et renvoie Dest. La fonction SizeOf standard (Delphi) ou l'opérateur sizeof (C++) peut être utilisé afin de déterminer le paramètre MaxLen. MaxLen est généralement égal à SizeOf(Dest)-1.
Remarque : StrLCopy copie le zéro terminal ainsi que MaxLen caractères. Vérifiez que Dest est assez grand pour contenir le zéro terminal.