pointers - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

pointers

I wrote the following program, but I have questions

[code]Var p01,p02,p03,p04:^byte;
Begin
getmem(p01,1024*1024*1024);
if (p01<>nil) then Writeln('ok 1')
else Writeln('ko 1');

getmem(p02,1024*1024*1024);
if (p02<>nil) then Writeln('ok 2')
else Writeln('ko 2');

getmem(p03,1024*1024*1024);
if (p03<>nil) then Writeln('ok 3')
else Writeln('ko 3');

getmem(p04,1024*1024*1024);
if (p04<>nil) then Writeln('ok 4')
else Writeln('ko 4');
End.[/code]

How I can know, that I have no memory for pointers?
How I can avoid the error "Runtime error 203..."?
How I can create pointers of 4 GB or larger size?

thanks.



Sign In or Register to comment.