L12_Arrays - Arrays Arrays • basic use of 1D arrays •...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

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: Arrays Arrays • basic use of 1D arrays • passing as parameters EECS 183 University of Michigan Lecture 13 – arrays ML Dorf Allen Telescope Array (ATA) Allen Telescope Array (ATA) EECS 183 University of Michigan Lecture 13 – arrays ML Dorf Wind Turbines Wind Turbines EECS 183 University of Michigan Lecture 13 – arrays ML Dorf The Power of Wind The Power of Wind EECS 183 University of Michigan Lecture 13 – arrays ML Dorf Arrays Arrays int score[ ] = {30, 40, 39, 35, 14, 21 }; score EECS 183 University of Michigan Lecture 13 – arrays ML Dorf score[0] score[1] score[2] score[3] score[4] score[5] 30 40 39 35 14 21 SIX items ONE name use SUBSCRIPTS to access Could also have declared as: Could also have declared as: int score[ 6 ] = {30, 40, 39, 35, 14, 21 }; score EECS 183 University of Michigan Lecture 13 – arrays ML Dorf score[0] score[1] score[2] score[3] score[4] score[5] 30 40 39 35 14 21 How to get data into an array? How to get data into an array? int score[ 6 ]; // declare score score[0] score[1] score[2] score[3] score[4] score[5] ?? ?? ?? ?? ?? ?? EECS 183 University of Michigan Lecture 13 – arrays ML Dorf score[0] = 42; // assign a value in score[0] score[1] score[2] score[3] score[4] score[5] 42 ?? ?? ?? ?? ?? How to get data into an array? How to get data into an array? int score[ 6 ]; // declare score score[0] score[1] score[2] score[3] score[4] score[5] ?? ?? ?? ?? ?? ?? EECS 183 University of Michigan Lecture 13 – arrays ML Dorf score[0] = 42; score[1] = score[0] + 5; // compute using another ‘cell’ score[0] score[1] score[2] score[3] score[4] score[5] 42 47 ?? ??...
View Full Document

{[ snackBarMessage ]}

Page1 / 22

L12_Arrays - Arrays Arrays • basic use of 1D arrays •...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online