Materie: | Appunti |
Categoria: | Informatica |
Voto: | 1 (2) |
Download: | 122 |
Data: | 12.02.2001 |
Numero di pagine: | 1 |
Formato di file: | .doc (Microsoft Word) |
Download
Anteprima
esercizio-puntatori_1.zip (Dimensione: 2.47 Kb)
trucheck.it_esercizio-sui-puntatori.doc 20 Kb
readme.txt 59 Bytes
Testo
program punta;
uses crt;
type
parola = record
nome:string[15];
taglia : byte;
var
puntat : pointer;
a,b,c : ^integer;
begin
clrscr;
new(p1); {alloca la variabile a }
mark(puntat); {salva lo stato dell'heap}
new(b); {alloca la variabile b}
new(c); {alloca la variabile c}
release(puntat); {rilascia la memoria riservata a b e c e ritorna alla stato heap salvato con la procedura mark}
if maxavail < sizeof (puntat) then
write(' memoria non trovata');
else
begin
getmem(puntat, sizeof (puntat)); {alloca memoria nell'heap}
freemem(puntat, sizeof (puntat));
end;
writeln(memavail, ' bytes disponibili');
writeln('La parte di memoria più ampia è ', maxavail, 'bytes');
readln;
end.