Hi, I would like to know how to port this code in Delphi
a : Word;
b : ^Word;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
b := @a;
Inc(b^);
//Display a
end;
To code in .NET, The problem is converting the pointer.
The Migrating Pointer Types section in the Codegear help gives this example however it does not explain it very well on how to use it.
var
P: Pointer;
I: Integer;
begin
I := 5;
P := @I;
could be converted to
var
P: TObject;
I: Integer;
begin
I := 5;
P := TObject(I);