MIS 24053 Lecture Notes - Lecture 27: Array Data Structure, For Loop
Document Summary
An array is a collection of data elements that are of the same type (e. g. , a collection of integers, collection of characters, collection of doubles). Given a list of test scores, determine the maximum and minimum scores. Read in a list of student names and rearrange them in alphabetical order (sorting). Given the height measurements of students in a class, output the names of those students who are taller than average. The array elements are all values of the type . The size of the array is indicated by , the number of elements in the array. must be an int constant or a constant expression. Note that an array can have multiple dimensions. Declare an array of 10 integers: int ar[10]; // array of 10 ints. To access an individual element we must apply a subscript to array named ar. The expression in the brackets is known as the index.