The array name testing is the address of the ini4al

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: has a data type integer and 10 elements that are indexed 0 to 9. 9 Introduc4on to Arrays (cont’d) • Each element in an array is accessed (referenced) using the array name and the element’s number, or subscript. – testing[0] is the 1st element, (ini4al or 0th item). –… – testing[7] is the 8th element (7th item). • The integer within the [ ] brackets is the subscript. • The array name testing is the address of the ini4al array element. (Remember this) 10 Array Declara4on The only difference between declaring a variable and an array, is the array will have an index aRer the variable name. – For example: int x, y[8]; Both x and y are integer types, but x will hold one integer value and y will hold...
View Full Document

This document was uploaded on 03/10/2014 for the course ENGINEER 2sh4 at McMaster University.

Ask a homework question - tutors are online