Pascal pass array to function
Pascal array index start...
Pascal dynamic arrayArrays
Contents
Answers
1. What is the array?
Arrays are the limited and ordered set of the values, which are the same type. Every single value is called the item (component) of array.
⇑
2.
What data types can be the array items?
The array type can be any, adopted in Pascal, except for the file type.
Pascal packed array
This type is a base type.
⇑
3. How to define the one-dimensional array?
According to Pascal syntax, you can define the array by two ways. First way – in the “var” section.
The second way – by using his own type definition in the “type” section.
Way 1. Definition of one-dimensional array in the var section of variables definition.
var m1:array[1..100] ofinteger; // an array of 100 integers m2:array[1..50] ofreal; // an array of 50 real numbers m3:array[-20..30] ofchar; // an array of 51 characters m4:array[5..5] ofboolean; // an array that contains 1 item of "boolean" typeWay 2.
Definition of one-dimensional array by using the “type” section.
type TM1 = array [1..100] of integer;