23 views3 pages

Document Summary

Collection of elements of the same data type. All the elements are stored in contiguous memory locations. Each element can be accessed randomly using a subscript (index) Data_type could be a primitive data type or adt(user defined) Array name: follows the same rules as any other variable(i. e. cannot start. Size: an integer value(it has to be a constant: literal, named or. Size tells how much memory has to be reserved for the array. The elements can be accessed through the index value. In c, the first valid index value is 0: the ith element will have an index i-1. The index has to be an integer (or integer expression) i. e. c[2] = 4; int i=6; c[ i ]=12; The memory reserved for an array: int x[10]; int uses 4 bytes the array reserved spaced for 10 integers the size of x is 4*10= 40 bytes.

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