13-Arrays-4up

use include 0 n 1 240711 val 0 feb idx an

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: Feb : ì Idx An ordered list of element of the same Jan type, each accessible by their index. daysPerMonth[0] = 31; // January 4 Initializing an Array Array Bounds ì Array can be initialized when declared: int somePrimes= {2,3,5}; : # of values in the initializer list... sets the size of the array ì Initialized Array of strings: string monthNames = { "January", "February", .... "December" }; ì 0 hoursWorked.cpp 5 Copying an array 24/07/11 1 4 2 6 3 8 4 10 5 12 6 14 7 16 8 18 An array variable... points to array's memory. Comparing array variables compares the memory addresses of the arrays, not their contents int first[3] = {1, 2, 3}, second[3] = {1, 2, 3}; if (first == second) { // Likely bug. // ... } first and second are differen...
View Full Document

This note was uploaded on 10/09/2012 for the course CMPT 125 taught by Professor Diana during the Spring '08 term at Simon Fraser.

Ask a homework question - tutors are online