控制台程序输出内存地址
//这是一个控制台程序;
procedure Abc;
var
str,s,s1,s2:string;
pstr:pChar;
begin
str := '123456';
s := IntToHex(Integer(@str),8);
//如果要输出地址,需要把地址强制转换为整形才可以输出;相对于这方面vc++直接就可以输出屏幕了
s1 := IntToHex(Integer(@str[1]),8);
s2 := IntToHex(Integer(@str[2]),8);
Writeln(s);
Writeln(s1);
Writeln(s2);
end;
begin
Writeln('hello, world!');
Abc; //调用上面的过程;
Readln; //Delphi 的Dos窗口 一闪而过的解决办法。
end.