var S: string; begin SetLength(S, MAX_SIZE; // when casting to a PChar, be sure the string is not empty SetLength(S, GetModuleFilename( 0, PChar(S), Length(S) ) ); // statements end;Begin with Application do begin NormalizeTopMosts; MessageBox('This should be on top.', PChar(AString), MB_OK); RestoreTopMosts; end; end;
PChar不是函数,是类型,用于类型的强制转换!如 var s: PChar; begin s := PChar('ddadfa'); String转PChar!! end;================================================================ ◆◆◆ CSDN查询助手,查询方便快捷 ◆◆◆ 下载地址: http://CoolSlob.ifood1.com/Download/CSDNFinder.exe http://CoolSlob.8u8.com/Download/Tools/CSDNFinder.Slob[更名为.exe即可]
begin
SetLength(S, MAX_SIZE; // when casting to a PChar, be sure the string is not empty
SetLength(S, GetModuleFilename( 0, PChar(S), Length(S) ) );
// statements
end;Begin with Application do
begin
NormalizeTopMosts;
MessageBox('This should be on top.', PChar(AString), MB_OK);
RestoreTopMosts;
end;
end;
var
s: PChar;
begin
s := PChar('ddadfa'); String转PChar!!
end;================================================================
◆◆◆ CSDN查询助手,查询方便快捷 ◆◆◆ 下载地址:
http://CoolSlob.ifood1.com/Download/CSDNFinder.exe
http://CoolSlob.8u8.com/Download/Tools/CSDNFinder.Slob[更名为.exe即可]
var
s:string;
p:pchar;
begin
s:='hello,world!';
p:=pchar(s);
在某些必须使用PCHAR类型的场合,就是这样转化的
當然,若愿意,可把你的EMail發給我,我有Object pascal 1.0語法參考手冊.
不錯的一本書(*.pdf)
同意: webnumen(现代孔子)