Previous topic | Next topic | Ada Home Page | Index

Unconstrained Arrays

We have only used constrained array types so far

Ada also provides unconstrained array types

Examples:

    type int_u_array is array (INTEGER range <>) of INTEGER;

    small_int_array : int_u_array (1 .. 3);	-- just 3 items

    big_int_array   : int_u_array (1 .. 100);	-- 100 items

    type char_count is array (CHARACTER range <>) of INTEGER;

    subtype digit_count is char_count('0' .. '9');

    uc_counts : char_count ('A' .. 'Z');

    dig_counts : digit_count;

STRING is an unconstrained array type

    type STRING is array (POSITIVE range <>) of CHARACTER;


Previous topic | Next topic | Ada Home Page | Index
c-lokan@adfa.oz.au / 27 Feb 96