Wolfgang Chien's Homepage | Delphi學習筆記 - 問答篇 |
string 與 pchar 的轉換形別要如何做?
以下摘自 Delphi OnLine Help
function StrPas(Str: PChar): string; Description The StrPas function converts the null-terminated Str to a Pascal-style string. ---------------------------- function StrPCopy(Dest: PChar; Source: string): PChar; Description The StrPCopy function copies a Pascal-style string Source into a null-terminated string Dest.
值得注意的是: StrPCopy() 並不作目的字串長度的檢查
後記: Delphi 2.0 的長字串提供兩者者更好的相容性, 請查 Online Help 有關 AnsiString 的說明
首頁 | 學習筆記 | 主題公園 | 軟體下載 | 關於本站 | 討論信群 | 相約下次 |