Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program xxx (input, output); // DInamicke promjenljive ne rezervisu prostor unaprijed. Koristimo pokazivace za njih.
- type student = record
- broj : integer;
- godina : integer;
- end;
- pokazivac = ^student;
- var p1, p2 : pokazivac;
- begin
- new(p1); // rezervise prostor u memoriji na kome ce biti upisan novi dinamicki slog. p1 ce pokazivati na njegovu adresu.
- p1^.broj := 1;
- p1^. godina := 2018;
- writeln(p1^.broj, '/', p1^.godina);
- new(p2);
- p2^.broj := 2;
- p2^.godina := 2018;
- writeln(p2^.broj, '/', p2^.godina);
- p1 := p2;
- p2^.broj := 3;
- p2^.godina := 2019;
- writeln(p2^.broj, '/', p2^.godina, ' ', p1^.broj, '/', p1^.godina);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement