-
-
Save menjaraz/af7532d2852a829070856fd9eddad286 to your computer and use it in GitHub Desktop.
DelphiにおけるStringをPAnsiCharへ安全に変換する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ConvertStringToPAnsiChar(str:string):PAnsiChar; | |
var | |
p:PAnsiChar; | |
begin | |
GetMem(p, Length(string) + 1); | |
System.AnsiStrings.StrPCopy(p, str); | |
Result := p; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment