Previous topic |
Next topic |
Ada Home Page |
Index
Storage allocation
Allocator
new T
- T is arbitrary data type
- memory is allocated for an object of type T
- pointer to that memory is returned
new T'(value)
- memory allocated as above
- initial value stored in that memory
- pointer to the memory is returned
examples:
Allocation with records
data type for dynamic data structures is usually a record
type contact is record
initials : string(1..3);
extension : integer;
end;
examples:
Previous topic |
Next topic |
Ada Home Page |
Index
c-lokan@adfa.oz.au / 26 Feb 96