
December 7th, 2003, 08:17 AM
|
|
Junior Member
|
|
Join Date: Dec 2003
Location: behind'da computer
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Pointers
hello! how could i get something like this working, in turbo pascal it worked, but in delphi it displays access violation error:
While App1 is executed and awaits the readln, execute App2.
programm App1;
{$APPTYPE CONSOLE}
var p:^string;
begin
new(p);
p^:='this string should be displayed';
// now typecast pointer to longint, and display it
writeln(inttostr(longint(p)));
// now execute second application
readln;
dispose(p);
end;
programm App2;
{$APPTYPE CONSOLE}
var l:longint;
p:^string;
begin
// at this prompt type what the App1 shows:
readln(l);
p:=pointer(l);
writeln(p^);
end;
|