









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Following points have been discussed in these lecture slides by Baljit Ashvin at Indian Institute of Information Technology (IIIT) under subject of Computer Fundamentals: Arrays, Comments, Accessing, Dimensional, Declare, Initialize, Operators, Prototype, Statement, Initializers
Typology: Slides
1 / 17
This page cannot be seen from the preview
Don't miss anything!










Name of array (Note that all elements of this array have the same name, c )
Position number of the element within array c
c[6]
- 6 **0 72 1543
0 62
1 6453 78**
c[0] c[1] c[2] c[3]
c[11]
c[10]
c[9]
c[8]
c[7]
c[5]
c[4]
5
7
int n[ 5 ] = { 1, 2, 3, 4, 5 };
int n[ ] = { 1, 2, 3, 4, 5 };
where indexExp, called index , is any expression whose value
is a nonnegative integer
braces
double sales[] = {12.25, 32.50, 16.90, 23, 45.68};
int list[10] = {0};
declares list to be an array of 10 components and initializes all components to zero
int list[10] = {8, 5, 12};
declares list to be an array of 10 components, initializes list[0] to 8 , list[1] to 5 , list[2] to 12 and all other components are initialized to 0
Restrictions on Array Processing
Assignment does not work with arrays
In order to copy one array into another array we must copy component-wise
Restrictions on Array Processing
(continued)