comp.lang.ada
 help / color / mirror / Atom feed
* unconstrained records
@ 2002-12-22 12:24 Jan
  2002-12-22 13:52 ` SteveD
  0 siblings, 1 reply; 6+ messages in thread
From: Jan @ 2002-12-22 12:24 UTC (permalink / raw)


Hi,

I have found an interesting source code in the book "Ada in action",
but the book could be better, because there is no background
information. Here is the problem:

procedure UnConstrained_Record is

   type Test (length : natural := 0) is
     record
        text : string (1..length);
     end record;

name : Test;

begin

   name := (5, "Bimbo");

   -- now I can resize the array inside the record

   name := (14, "This is a test");

   -- but now it comes

   name := (3, "abc");

   -- What happens to the memory? Are the 11 bytes freed           
   -- automatically?

end UnConstrained_Record;


Thanks!



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-12-27 20:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-22 12:24 unconstrained records Jan
2002-12-22 13:52 ` SteveD
2002-12-22 18:54   ` Jan
2002-12-22 19:14     ` Robert A Duff
2002-12-27 20:34       ` Randy Brukardt
2002-12-23  4:30     ` SteveD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox