Portability questions (Arrays)

Fri, 2 May 1997 12:45:03 +0200



Hi everyone!

Two questions about portability of properties of arrays:

Let's assume a:array[x..y] of t (not a packed array).

1. Is it safe to assume -- for all platforms, including possible future
   ones -- that SizeOf(a) = ((Ord(y)-Ord(x)+1) * SizeOf(t)?

2. Is it safe to assume that
   Integer(@a[p])-Integer(@a[q]) = (p-q) * SizeOf(t)?
   (Is it generally allowed to cast a pointer into an integer,
   in the first place?)
-- 
Frank Heckenbach, Erlangen, Germany
heckenb@mi.uni-erlangen.de
Turbo Pascal:   http://www.mi.uni-erlangen.de/~heckenb/programs.htm
Internet links: http://www.mi.uni-erlangen.de/~heckenb/links.htm


Frank Heckenbach (heckenb@mi.uni-erlangen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es