Engineering Science 1036A/B Lecture Notes - Lecture 6: Array Data Structure, Null Character, Code Segment

64 views13 pages

Document Summary

An array is a set of consecutive memory locations used to store same types of data. Each items in an array is called an element. The number of elements in an array is called the dimension or the size of the array. An array shares a common identifier and data type: C++ requires that the array size must be a constant expression. Individual elements of an array are specified using offsets referred to as index or subscripts. The index of the first element of an array always has a subscript value zero, e. g myarray [0] holds the first element of the array myarray[10] (as an example) The index of the last element of the array always has a subscript value of [dimension 1]. For the array declared int myarray[10] the last element goes to myarray[9] Each element in the array is represented using the following syntax, known as an indexed variable: arrayname[index];

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions