Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Pascal/HP-UX Programmer's Guide > Chapter 5 Allocation and Alignment

Arrays

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Arrays are stored in row-major order. This means that an array is stored a row at a time, rather than a column at a time (column-major order).

Example

VAR
a : ARRAY [1..2,1..3] OF char;

Row-major order:

Figure 5-4 Array Example 1

Array Example 1

Column-major order:

Figure 5-5 Array Example 2

Array Example 2

The HP Pascal packing algorithm uses this formula to allocate an array:

number_of_elements * space_for_one_element

The space_for_one_element depends upon the array element type and whether the array is unpacked, packed, or crunched. The same factors determine element alignment. See the tables indicated below:

 

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.