Guest User

Untitled

a guest
Feb 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 0.52 KB | None | 0 0
  1. with Ada.Text_IO;
  2.  
  3.  
  4. procedure Aufgabe12 is
  5.    
  6.    type Z is array (Integer range <>) of Integer;
  7.    type X is access Z;
  8.    
  9.    P : X := new Z (1 .. 20000000);
  10.    Q : X := new Z (1 .. 20000000);
  11.    C : Character;
  12.    
  13. begin
  14.    P.all := (others => 4);
  15.    Q.all := (others => 5);
  16.    
  17.    Ada.Text_IO.Put_Line (Integer'Image (P (1)));
  18.    P := Q;
  19.    --  Der Array, auf den P zeigt(e), ist jetzt verloren -> Speicherleck
  20.    Ada.Text_IO.Put_Line (Integer'Image (P (1)));
  21.    Ada.Text_IO.Get (C);
  22.      
  23. end Aufgabe12;
Add Comment
Please, Sign In to add comment