final - Chatper 9 Intro to Arrays An array is a list of...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Chatper 9 Intro to Arrays An array is a list of variables, each with a two-part name. one part is the same for each variable that make up the array. And the other is is different for each variable. Type smallarray = array [1. .5] of integer; var score: smallarray; The component type is given after the word of and can be integer, boolean, or char. An index variable as score[1] can be used anyplace that an ordinary variable of type integer can be used. Expression in the brackets is called the index. An array index is truly integer variables only. Neither the square brackets r the index expression is included in the declaration of the array. It is possible to use a type definition directly instead of first defining a type name. program sample; var A, B: array[1. .100] of real; It is better to declare names for defined tyes and to refer to the types by name. a formal parameter list CANNOT contain any type definitions, only type names. You CANNOT use an entire array as a parameter to a read or readln
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/28/2008 for the course CPSC 110 taught by Professor Logan during the Spring '07 term at Texas A&M.

Page1 / 3

final - Chatper 9 Intro to Arrays An array is a list of...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online